Repository navigation
Conversation
|
My understand of an advantage of the post-order encoding is that it reduces the need for the decoder to maintain a production stack of nodes still pending reduction. For some operations such as This patch appears to be in support of moving state that the decoder will need to track anyway into explicit opcodes. For example to encode it as: If using a post-order encoding then could you please consider a mixed post/pre order encoding that keeps the pre-order encoding where pre-order information needs to be maintained by the decoder anyway, and for the reason of avoiding explicit redundant information in the binary encoding. If using a post-order encoding for I would note that my experiments show that replacing If a pre-order encoding wins on the compressed file size and the wasm binary format adopts a post-order encoding then the pipeline may well be permuting the order which I guess would be at least as costly and resource intensive as the decoder tracking the productions stack. A small win for the decoder might not justify a decision on pre/post order when put in perspective. |
|
Also if making this change then could you please consider supporting |
|
Sorry, I see the patch is already 'taking advantage of the opportunities and accepting a sequence of expressions in the In terms of the README syntax could you please also consider: |
|
@JSStats, the binary format and this patch already allow sequences of expressions in the branches, please reread the patch description. As for dropping the then-branch, the binary format will not be able to express that directly, it effectively requires an empty sequence. Could allow it as a shorthand in the text format, but not sure it's worth it. |
|
@rossberg-chromium Yes, thanks, missed that on first reading, sorry again. Shall be interesting to see how supporting block here helps - I do see the pattern and think it will help. It's a bit hard to comment without knowing what people actually have in mind for the post-order binary encoding for |
|
Sorry again, obviously it would not be possible to allow the final closing operator to be missing, so one more operator might be needed. For example: |
|
lgtm |
Adjust `if` to match post-order format.
The post-order binary format induces minor changes to
if:if, with and without else-branch.This PR reflects these generalisations in the AST and the S-expression format. Unfortunately, this required tagging the branch blocks in the S-expression syntax, so that the both lists can be distinguished. The tags can be omitted if the sequence consists of exactly one expression, thereby keeping the previous concrete syntax valid. See README for details.