The LDC D language compiler can now generate WebAssembly
wiki.dlang.org
wiki.dlang.org
There was a way to compile D to WASM before (using the dscripten package), however that was more akin to a collection of loose pieces strung together.
As with Go, a big obstacle for running typical D code in browsers is reliance on a garbage collector, which requires scanning stacks and temporaries for reachable heap object. Though it's possible to overcome in theory with just compiler support, garbage collection in WASM itself seems to be an ongoing discussion.
Also carried the large Emcripten runtime. Sure it gives you a lot of things like posix impls, but the unknown triple is very lightweight (at the cost of sys/OS abstractions of course).
And also, SDL2 + opengl bindings. Which makes it very adapted to compiling the same project for both targets: native and web. For video games, this is a killer feature (e.g try the game in your browser, and if you like it, download the native app (smoother, less input latency)).
Why can't they just let devs embed their own garbage collector? Isn't he role of an assembly language to let the developer do stuff at a low level?
I also think its better for everyone if you don't need to load/download, decode, compile and run a full language runtime on every page load. Imagine a JVM running on web assembly: Every page load first has to decode and compile a full many-MB JVM, then the JVM can start booting - without any platform/architecture specific optimizations.
The more stuff that's common for webasm-targeting-languages that we can move into the browser, the less effort wasted overall.
Almost makes me wish VBScript IE had won. We might be writing browser apps in .NET now...
I still have to do .stream() and .toList() (or .collect(Collectors.toList())) back and forth in Java all the time just to get reliable access to map/filter lambdas while still having a valid return value.
Better stop using Chrome now.
Chrome seem to have a bunch of 2018 vulnerabilities that aren't listed here though...
At least not unless you can load it from the same public CDN.
Edit: Actully, I'm not sure you could do that even with the public CDN.
I believe the big obstacle is that the stack is managed by the VM and isn't accessible directly (at least, in the form of one continuous memory region per thread). A likely constraint that led to this was to allow interoperability with the JavaScript stack.
Indeed :-)
The toolchain building scripts were a maintainance nightmare ; I'll be happy to drastically simplify them, especially if it means I can now use the vanilla LDC compiler (instead of having to integrate fastcomp and clang-fastcomp (Emscripten's forks of llvm and clang, respectively)).