I see there as being basically three reasonable choices:
- GNU assembler (GAS), the current implemented behavior and easy to hand directly to LLVM
- WAT (WebAssembly text format), the specification text format for WebAssembly
- WAST (WebAssembly script syntax), an unofficial superset of WAT syntax which is easier to write by hand, used for reference implementation tests
asm!, GAS syntax is reasonable and seems to fall somewhere between WAT and WAST (e.g. allows using symbolic names instead of indices, but doesn't allow s-expression parameters instead of stack parameters). But for
.directives required are much more opaque (and bordering undocumented) than WAST
(func $name ...),
(export ...), etc.
Pure WAT seems unusable due to reliance on global order indices. But WAST is "official unofficial" (since it's used by reference material) and certainly moreso than GAS. Given we already set
.syntax for GAS, it seems reasonable that we'd choose to use WAST instead of GAS on wasm, so long as there isn't anything useful doable with GAS that isn't with WAST.
I'm far from familiar with GAS, let alone wasm GAS, so: is there functionality available through GAS that wouldn't be through just WAST that would be useful for Rust on wasm?