4 ms·
If all you need in js/wasm is the functional layer of the language, that could be easy. If you want to add processes, that could be very hard. If you also wan
by pmontra 10y ago
If all you need in js/wasm is the functional layer of the language, that could be easy.
If you want to add processes, that could be very hard.
If you also want the supervisors, that's difficult but probably not has much as adding Erlang style processes.
- pmarreck 10y agoWhat's stopping a compile of Erlang to JS via LLVM and Emscripten and just taking the expected performance hit?
- Xixi 10y agoErlang doesn't compile to machine code, but to bytecode that runs into the Erlang VM. So you would probably have to run the Erlang VM on top of javascript... I'm not sure whether it's possible, but it sure sounds heavy.
- int_19h 10y agoWith WebAssembly, you should be able to compile the Erlang VM itself to it.
- bryanjos 10y agoThere is the LLVM backend in Erlang as of version 17. I haven't seen much info on it. I haven't seen anyone try to go the whole process from Erlang code to LLVM to Emscripten to JavaScript. I am interested to know what hurdles there might be, performance, etc.
- lawik 10y agoAFAIK the VM creates a thread per core (by default) and schedules Processes across those threads and stuff. I'd say this might be possible to do with Web Workers. Sounds like it could be fun, probably a challenge to make it fast.