Why not target WASM instead of JS/TS? (Is the author on Lobsters?)
WASM isn’t just a “lower-level JS” and a completely separate execution environment. Features of JS might be cheap to use in WASM or not, depending on the amount of glue needed (e.g. JS numbers are notoriously FFI unfriendly).
I’m not the author, but WASM is not ready for general use yet. It can’t do much without requiring a heavy JS wrapper.
Figma runs on WebAssembly… I guess you could still argue it is not “general use”, but it certainly is production ready.
He’s the compiler, he can emit whatever code he wants, including arbitrary JS linkage via exports and imports on the instance.
Yes, but the JS linkage would have to be heavy. Have you seen how much bloat is added by Emscripten?