On Wednesday, 3 August 2016 at 20:26:23 UTC, Sebastien Alaiwan
I finally managed to compile some D code to asm.js, using
It had been done by one dude several years ago, but some
changes in the inner workings of Emscripten (the introduction
of fastcomp, also probably combined with changes in the way LDC
generates LLVM bitcode) made it impossible to use the same
You can play a minimalistic demo:
The source code + toolchain deployment scripts are available on
And a blogpost explaining the technique is available here:
(Spoiler: at some point, it involves lowering the source code
back to C)
Please let me know what you think!
Do you still know the modifications you made to compile LDC with
emscripten-fastcomp? I would be interested to have a look into
the "PNaCl legalization passes" problem.