I'm not sure if this is the correct section for this, but WebAssembly support was brought up in this thread. Is there any ongoing work on this front? Is there some place we can track that work? If we wanted to pitch in, is there a good place to start?
There has been some discussion and a little work (but no working compilation to wasm) in this GitHub issue a few months ago: https://github.com/kripken/emscripten/issues/2427.
I have seen that issue. Do folks think using emscripten is the right path forward? I may be misremembering but I think the Rust folks started with emscripten and then rolled their own wasm target.
I'm neither a compiler- nor wasm-expert, but at least some of the changes posted in the last few comments on the issue look like they'd be relevant either way. From the little research on wasm vs. emscripten I did just now, it looks to me like the first step would be to allow the LLVM wasm backend to work with Swift, which I think is the backend both Clang and Rust (which indeed switched from the backend coming with emscripten) use.
Even when using that, It looks to me like emscripten can still be used to generate glue code and provide shims for libc, opengl and such things (I think that's what it is at least). Rust is using their own system, wasm-bindgen for at least a part of what emscripten provides, but I'm not sure whether they are still using emscripten for other functionality.
The wasm project also has at least some of the features emscripten provides on their roadmap
While the original issue has been created in the emscripten repository, it contains the discussion of using LLVM WebAssembly backend and a few patches for the Swift toolchain for enabling that. I haven't seen any more work done on that in the Swift toolchain for the last half a year, but LLVM 7.0 had some good progress on WebAssembly target since then. I've pulled LLVM 7.0 updates and rebased the patches, which now live in these branches:
It looks like the main blocker is going to be the dependency on glibc. My understanding is being able to switch from glibc to musl in Swift toolchain would be super helpful, especially as there was some progress in porting musl to WebAssembly: https://github.com/jfbastien/musl