Open Yoric opened 6 years ago
I believe this is the right way forward too. IMO the biggest gain here is that it makes adoption a lot more practical. Old codebases have an option to get faster loading and streaming compilation (fingers crossed!) without opting into backwards incompatible Early Error semantics.
I'll work on adding support for this in the encoder and decoder.
The following is a proposal to make clearer in the specifications which parts may be skipped and which may not.
Current state
In the current state of things, all lists may be skipped. This was decided because it was clear that hardcoding arbitrary interface names in the detokenizer was a bad idea, and because the only alternatives were allowing all interfaces to be skipped or allowing all lists to be skipped.
This is generally a waste of bytes, as we don't care about skipping most lists.
Proposal
Attribute
We add an extended attribute
[Skippable]
to interfaces. A[Skippable]
interface is one in whichExample
Now, we redefine
FunctionDeclaration
as follows:We apply the same treatment to other functions/method/getter/setter/...
Expected benefits
EagerFunctionDeclaration
andSkippableFunctionDeclaration
.