I understand from the docs that there are no current plans for WASM; I’m just wondering at what stage this might be prioritized (and if there is a guide to what stages / versions / progress Mojo is currently in?)
WASM is currently undergoing a lot of shakeup, around things like WASM components (which offer cross-language interop, garbage collection support (which we might have to deal with due to WASM components), and several competing IO models (WASI, WASIX, etc). Given that Mojo is a newer language, we should probably let the dust settle a bit there and save possibly wasted implementation effort for the a more finalized version of WASM, using the excess for other parts of the language.
errr what? WASM isn’t undergoing a lot of shakeup, where did you hear this? And WASIX is not a competing IO model to WASI. WASM has been stable in browsers for a long time, although yes, there are features being added / rolled out on a continual basis, similar to other web standards. But there is no “finalized version of WASM” that we’re going to get to (it’s like saying there will be a “finalized version of CSS”); WASM already has a final version, but individual features may continuously be added.
The part about garbage collection is interesting, related to WASM components. I assume that components manage their own memory, so Mojo wouldn’t have to do anything, but I could be wrong? I guess any values / pointers that travel across components might as you say require Mojo to support some that may be garbage collected, but I’m not sure.
WASM on the server is quite popular since it means you ship a WASM blob instead of an entire docker container, and we would be remiss to not consider that when building out WASM support for Mojo. If Modular were to just turn on the WASM backend in LLVM, that would still leave substantial components of Mojo’s runtime, as well as information that is expected to be present when compiling Mojo, absent. For example, async code in WASM is still very much work in progress, even in browsers. These are very important things for Mojo to consider when considering how Mojo features work in WASM. WASIX and WASI are competitors in that they are different IO models which are nearly impossible to be generic over in most languages. Which way the WASM ecosystem goes will help determine what Mojo has to do there.
There’s still a lot of work left in the WASM ecosystem before Mojo can cleanly map to WASM, especially without surprising behavior, so to my mind it’s best to wait. Later on, once Mojo is a bit more mature, it may be worthwhile to chase ever evolving web standards, but we can save the effort for now.