-
Notifications
You must be signed in to change notification settings - Fork 36
The else branch of if_except
should not be optional
#54
Comments
I don't understand. This works fine for |
Yeah, I'm not sure I feel strongly about this issue. In general I like balanced ifs, but "I like it" isn't a very strong argument in my opinion. "It makes decoding more complicated" is stronger, but as you point out, it's a minor complication. I'll give others a chance to speak up if they feel strongly, otherwise I'm happy to close the issue. |
My observation is that in at least two wasm consumers, something like So, I think what this suggests is: instead of |
Despite the minor inefficiencies in some consumers, there is value in being consistent with the prior |
The current version of the proposal uses |
This adds the new operations, as well as the new data and element segment formats. Implemented: * Text parsing/writing * Binary encoding/decoding * Validation TODO: * Tests * DataCount section * Proper encoding of passive element segments (using ref.null etc) * Evaluation
@sunfishcode pointed out that the fact that our current
if
instruction has an optionalelse
branch complicates decoding because we do not know at the time we see theif
instruction whether we are going to parse one block of instructions or two. We should avoid getting into that case here.One option is to always require an
else
branch forif_except
, which can be empty if its not needed. Another would be to have separate opcodes for the two-armed and one-armedif_except
blocks.What do people think?
The text was updated successfully, but these errors were encountered: