4 ms·
Follow-up question, why can't LLVM -> Web Assembly solve the problem?
by goalieca 9y ago
Follow-up question, why can't LLVM -> Web Assembly solve the problem?
- sitkack 9y agox86 elf -> wasm could solve this problem.
- kodablah 9y agoThat would take quite the effort to build, but I bet lifting to LLVM first might work: https://github.com/trailofbits/mcsema https://github.com/trailofbits/mcsema
- slrz 9y agoNo, it wouldn't. At that point you already lost lots of information and your only option is to faithfully reproduce the behaviour of the x86 machine. You can still do it, of course and performance isn't even that bad. See Fabrice Bellard's x86 emulator using asm.js. https://bellard.org/jslinux/tech.html https://bellard.org/jslinux/tech.html
- sitkack 9y agoOk, pick a better ISA, like RISC-V.
- ianburrell 9y agoThe regular Go compiler doesn't use LLVM. It is derived from Plan9 compiler toolchain. There has been work on a LLVM Go compiler. There is also Gccgo, Go frontend for GCC, that could use GCC WebAssembly backend.
- earenndil 9y agoCould use dragonegg[1] to run gccgo through llvm and then through emscripten. 1: https://dragonegg.llvm.org/ https://dragonegg.llvm.org/
- ecnahc515 9y agoIt can, emscripten supports this, however the primary Go compiler doesn't use LLVM so this doesn't help really.
- steveklabnik 9y agoEmscripten does, but LLVM does without emscripten too.
- pjmlp 9y agoBesides the issue of Go main compilers not using LLVM, that would only be about the instructions. There is no way around porting the runtime as well.
- johnhenry 9y agoThis is kind of what I was getting at... other languages seem to have a webasm pipeline that includes LLVM. I wanted to know what what the difference was between go and these languages that require one to use something other than LLVM.