To improve on the situation, I wrote some wrappers around the toolchain which allow using existing D build tools and workflows for targeting emscripten / WASM.
These come in the form of programs with the same general command-line syntax as
rdmd, so build tools such as Dub should be usable.
I’ve also included a copy of Phobos / Druntime hacked enough to get things like
Garbage collection is currently stubbed - allocations work but the memory is never freed (until the page is reloaded, of course).
test directory for some examples of what works.
- Code: https://github.com/CyberShadow/dscripten-tools
- Discussion: https://email@example.com
If you’re OK with starting from scratch, working entirely with
@nogc, and targeting WASM only,
LDC’s new WebAssembly target might suit you better.
Note: this article is back-dated, and was originally written on 2018-11-06.