wabt icon indicating copy to clipboard operation
wabt copied to clipboard

`(ref null extern)` fails parsing

Open eliben opened this issue 2 months ago • 4 comments

According to the WASM spec, externref is an alias for (ref null extern).

While externref works well in .wat files (for wat2wasm), (ref null extern) doesn't seem to be supported, even with --enable-all:

error: unexpected token null, expected a numeric index or a name

The same error appears if I try to parse (ref extern) (without the null).

eliben avatar Oct 03 '25 22:10 eliben

Hey Eli! Long time now see. Hope you are doing well.

Sadly, wabt is currently a little behind on reference types and GC proposals. It could be that fixing that alias would be easy enough, but there are whole queue of GC changes in open PRs right now (thanks to @zherczeg). Imagine this will be fixed when they (eventually) land.

sbc100 avatar Oct 03 '25 22:10 sbc100

👋 Sam, great to be in touch again.

Yes, I noticed a general lag around GC-related stuff and other new things from WASM 3.0

Would you say that bytecodealliance/wasm-tools is more up-to-date these days?

eliben avatar Oct 03 '25 23:10 eliben

👋 Sam, great to be in touch again.

Yes, I noticed a general lag around GC-related stuff and other new things from WASM 3.0

Would you say that bytecodealliance/wasm-tools is more up-to-date these days?

Yes, absolutely. I'm afraid wabt gets very little love these days. See #2348

sbc100 avatar Oct 03 '25 23:10 sbc100

@eliben you can use the branches with GC support: https://github.com/zherczeg/wabt/tree/gc_tests

It would be good to have a WebAssembly 3.0 compatible branch of wabt somewhere even if it is non official.

zherczeg avatar Oct 04 '25 04:10 zherczeg