Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Will be a huge pain in the ass. Go's compiler uses Plan 9, and WebAssembly uses LLVM.


There 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: