Hashlink + WebAssembly?


In @ncannasse’s recent heaps talk someone asked about wasm and he said “not yet” but it also sounded like there was maybe something brewing. Is there work being done anywhere on getting Hashlink to run inside wasm and act as a web target for HL? Would love to possibly help out with this effort.


I’m not sure what are the requirements but I think it should be quite straightforward to compile a HashLink/C application into WASM using Emscripten. Just give it a try and open issues on https://github.com/haxeFoundation/hashlink if you hit into some issue.


Is it more feasible to do that or get the actual Hashlink VM running as a wasm module? Embedding the VM itself as a module would be nice, so people could easily slot in .hl without needing to then recompile that itself to wasm.


That would work if HL VM had an interpreter but currently it’s only a JIT, so you need to use native C compilation. See https://github.com/HaxeFoundation/hashlink/issues/186 for interpreter wip