3 ms·
Isn't web assembly in the browser suited for these kinds of problems? You could run the code, spit the benchmarks and save that (maybe saving the code and the t
by AccountAccount1 4y ago
Isn't web assembly in the browser suited for these kinds of problems? You could run the code, spit the benchmarks and save that (maybe saving the code and the time of the submit for validation.)?
Does anyone know about this?
- paulgb 4y agoEven for languages that can compile to wasm (Go, Rust), the compilation toolchain doesn't necessarily run in the browser. AFAIK there's no good way to run LLVM in wasm yet. You could do the compilation on the server and then send it back down to the browser to run, though. Theoretically, it should be possible to do it all in the browser, just a lot more work given the state of things now.
- steveklabnik 4y agoSomeone did port clang to the browser, though I don’t have the moment to Google it right now. So LLVM has been done at least once.
- paulgb 4y agoOh cool, so they did! https://binji.github.io/wasm-clang/ https://binji.github.io/wasm-clang/
- azakai 4y agoHere are some more ports of LLVM and clang to wasm/the browser: * https://github.com/kripken/llvm-js https://github.com/kripken/llvm-js * https://github.com/tbfleming/cib https://github.com/tbfleming/cib * https://github.com/jprendes/emception https://github.com/jprendes/emception LLVM just does pure computation, really, so it's not hard to port to wasm - much simpler than say Python (which has also been ported several times). The only challenges with LLVM are the build system (which has self-execution), working around some issues like clang wanting to open a subprocess, and adding some ifdefs.
- nerpderp82 4y agoYou are much closer to Clang/LLVM than I am, how likely is it that these changes would get upstreamed? I see the clang.wasm ports, but really I'd like to get in-tree builds of each commit. I find clang.wasm extremely useful, but I all I have are snapshots and I don't have the skills (maybe the patience) to get main continuously building to wasm.
- azakai 4y agoHmm, I'm not a regular LLVM committer myself, but I think there's a chance. The history here has been several ports "for fun", so no one has tried to upstream anything. But if you have a real use case that could benefit from this, we should talk with the LLVM people and see. Feel free to file an issue and cc me and we'll find the right people.