A bit more Emscripten

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue May 8 08:53:36 UTC 2018


https://github.com/CyberShadow/dscripten-tools

This builds a little upon Sebastien Alaiwan (Ace17)'s excellent 
prior work of putting together a toolchain for compiling D to 
JavaScript / asm.js.

Improvements include a DMD-like driver and rdmd wrapper, meaning 
that most tools that know how to use dmd/rdmd will be able to 
also use this toolchain. Dub is an example. Currently the focus 
is on headless scripts - Web Workers and Node.

Also included are some hacked up parts of Phobos/Druntime. 
Generally such environments are restricted to @nogc stuff, but I 
wanted to see how far we can get without prior restrictions. As a 
result, things like Appender and format(...) (i.e. formatting to 
the heap) work. Of course, garbage collection is unavailable - 
it's using the "manual" GC implementation (allocates only), 
though considering most webpages are short-lived, it might not be 
a problem for many use cases.

I heard there was a bit of general interest on the subject, so 
would be interesting to hear about more potential use cases.



More information about the Digitalmars-d-announce mailing list