upvote
> WASM-as-IR .. (Is that a thing?)

Yes, actually I've heard of some projects compiling a language to Wasm, then using wasm2c to translate to C.

https://github.com/WebAssembly/wabt/blob/main/wasm2c/README....

The Zig project does something similar for their bootstrapping process with a custom wasm2c implementation with just the features they need.

https://github.com/ziglang/zig/blob/master/stage1/wasm2c.c

I get the feeling this is an underappreciated technique with more potential.

reply