Make format startup-/streaming-friendly #86
Labels
Specification: Byte streams
Specifications: Container format
Tools: Optimization levers
Stuff that users of command-line tools can decide depending on what they want to optimize
Generally, we want to make sure that all data that is required during startup should appear before data that is only required later.
So, what data do we need during startup?
Our assumption here is that we should optimize startup speed for code that is outside of any
Skippable
node, and that the encoder should figure out the rest.One way to do this would be to change the format from what we have now:
into
Semantics
SyntaxError
– this does not include code hidden in aSkippable
;DelayedSyntaxError
.In either case, the encoder is in charge of deciding where to best put grammar/strings/ast definitions. This is both an optimization lever and a question of semantics.
Rationale for the second point: attempting to execute a node that depends on something that is provided in a later table means blocking the run-to-completion until we have finished received network data. This is both complicated to implement and hard to specify, as receiving network data is observable by the DOM, which could in turn trigger JS code.
Further
Ideally, we'd like to get full streaming compilation/interpretation. This may mean more than 2 levels.
With the definition that any lookup in a table first looks up in stage 1, then if the table of stage 1 is not long enough stage 2, ...
Again, we'll let the encoder where to best place the data. Again, we'll need to decide of semantics for errors.
The text was updated successfully, but these errors were encountered: