wabt
wabt copied to clipboard
Function references support
I would like to parse some test files using wabt from the function reference (Phase 5) proposal such as call_ref.wast.
https://github.com/WebAssembly/function-references/blob/main/test/core/call_ref.wast
I have enabled the feature with --enable-function-references.
However, I get errors such as:
call_ref.wast:5:15: error: unexpected token $ii, expected ).
(call_ref $ii (local.get $x) (local.get $f))
^^^
The format of call_ref was changed in:
https://github.com/WebAssembly/function-references/commit/2b194cef87ba7f71c187b063a2ff8fea878e900a
May I ask the status of function reference support in wabt? Do you plan to support these proposal changes?
Thank you very much for the help!
This proposal is not yet fully supported. If you would like to take a look at adding support that would be great. Sadly wabt doesn't have many folks contributing these days to its hard to say when the proposal might get implemented.
I think my own long-term plan is to get wasm-tools's wat2wasm and wasm2wat (https://github.com/bytecodealliance/wasm-tools/) to the point where they can substitute fully for WABT's wat2wasm/wasm2wat, and then sunset WABT. wasm-tools already supports function-references and GC.
It would be helpful to hear: what are some of the features that you use from WABT, that wasm-tools is currently missing?
Thank you for the information. Contributing to wabt might be possible, but I cannot promise anything at the moment.
Wabt is C++, and can be added to C++ projects.
I will try to make a patch for this, but I have little experience with the project, so I need your guidance.
Could you help me with these questions:
-
How can I represent an s33 value? For example
typecan be a value type or func index: https://github.com/WebAssembly/wabt/blob/main/include/wabt/binary-reader.h#L298 -
How can I store a type in
Valstructure? Is this correct? The index is a large value, but still part ofuint32_trange. https://github.com/WebAssembly/wabt/blob/main/src/wast-parser.cc#L959 -
Type with argument looks like something new.
-0x1ctype (ref ht) has a$t : heaptype. How can I represent this?
To start from somewhere, I have created a branch: #2562
This issue can be closed. There are 6 patches implementing the whole GC support.
My apologies Zoltan for the lack of progress reviewing your changes. I do hope to find time to do it, and perhaps we can find others to help too.