> This is essentially just Rust with the compile target set to WASM, though?
It's not rust at all, it's a rust-like representation of wasm bytecode.
> WASM Text (WAT) is not really meant to be human-authored, it's an IR representation, like LLVM IR.
Which is exactly why TFA wrote an alternate representation, they're writing the runtime for a wasm target so they specifically want to craft their bytecode, and WAT is not a great thing to write.
Well the problem with an alternate syntax like this is that it's not really 1:1 with WAT so it ends up being hard for you easily figure out how to derive an exact WAT form from your starting language. WAX wouldn't eliminate this problem.
What I've been doing is making a simple library that can build WASM instructions in memory which closely follows the syntax and semantics, and using my programming language of choice as basically a preprocessor that provides high level abstractions over raw WAT/WASM. That method is VERY amenable to optimization, either by hand or via LLM. Because you can run your code generation, figure out how the bytecode should change, and work backwards. And if you take care while writing it, it can be very easy to follow the code.
Tbh I don't understand why people don't like the intermediate representation. It's ridiculously high level compared to say x64 or ARM or even RISC V assembly. It's a simple lisp that most high schoolers who have taken basic programming can read it without issue.
I can't think of a single other production level VM with such an easy to read decompiled form.