binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

[Parser] Issues to resolve before switching to the new wat parser

Open tlively opened this issue 2 years ago • 1 comments

These are the issues (in no particular order) that need to be resolved before we can turn on the new wat parser by default:

  • [x] The parser needs to support bottom and exn reftypes and heaptypes.
    • #6218
  • [x] The parser needs to support start functions.
    • #6256
  • [x] The parser needs to support v128.const.
    • #6275
  • [x] We need to make array.new_fixed length annotations mandatory.
    • #6277
  • [x] We need to remove support for the deprecated text format for string operations.
    • #6289
  • [x] The parser (really the lexer) needs to support the non-standard extended name format $"..." and the tests need to be updated to use it where necessary.
    • #6278
    • #6279
  • [x] The tests need to be updated to respect the rule that imports must precede declarations.
    • #6284
    • #6290
  • [x] The parser needs to support struct field names.
    • #6293
  • [x] [Outlining] The parser needs to support tuple types. We should also update the format for tuple types to be more consistent with the rest of the language. The parser needs to handle local.set and global.set of tuple types correctly.
    • #6246
    • #6249
    • #6250
  • [x] [Outlining] The parser needs to support multivalue pops. We should probably update the syntax of pops to be pop <valtype>, where the valtype can be a tuple type.
    • #6251
    • #6252
  • [ ] ~[Outlining] The parser needs to support pops in control flow structures somehow.~
  • [x] [Outlining] The parser needs to support the new EH instructions.
    • #6237
    • #6238
  • [x] The parser needs to support the implemented typed continuation instructions.
    • #6295
  • [x] The parser (and lexer) needs to support source map comments.
    • #6345
    • #6370
    • #6377
  • [ ] The parser match the behavior of the old parser w.r.t unreachable expressions.
  • [ ] The parser should support parsing the full wast scripting language, including extensions for threads.
  • [ ] We need to either add parser support for Poppy IR or remove the Poppy IR tests.

tlively avatar Jan 06 '24 01:01 tlively

Perhaps also worth adding https://github.com/WebAssembly/binaryen/issues/3989 as it blocks us from running the text roundtripping fuzzer, and it would be good to have that fuzzer tested on the new parser:

https://github.com/WebAssembly/binaryen/blob/e5948a939eb6610f1cb7742df8c54f6d17389b83/scripts/fuzz_opt.py#L1386-L1387

kripken avatar Jan 11 '24 19:01 kripken

The new parser is now on by default, so closing this issue.

tlively avatar May 20 '24 22:05 tlively