3 ms·
I'm very interested in compiling Go to WebAssembly. Based on what I read, it seems that so far you can primarily try it with C/C++ code. If one were to build a
by shurcooL 11y ago
I'm very interested in compiling Go to WebAssembly. Based on what I read, it seems that so far you can primarily try it with C/C++ code.
If one were to build a Go -> WebAssembly compiler, what are good routes to take? I can see there's going to be multiple possibilities.
- frame_perfect 11y agoWill be a huge pain in the ass. Go's compiler uses Plan 9, and WebAssembly uses LLVM.
- adrusi 11y agoThere is llgo[1] which is an implementation of go on top of the llvm toolchain. But if I'm not mistaken, WebAssembly won't accept just any llvm bitcode. It's similar to how emscripten will work with the bitcode that clang outputs, but not other llvm compilers like rust or ghc. [1]: http://llvm.org/svn/llvm-project/llgo/trunk/README.TXT http://llvm.org/svn/llvm-project/llgo/trunk/README.TXT