D and WebAssembly (Wasm)

Paul Backus snarwin at gmail.com
Mon Sep 13 16:36:28 UTC 2021


On Monday, 13 September 2021 at 16:19:31 UTC, Kenneth Dallmann 
wrote:
> With D not being able to be run on Wasm in a meaning way: Why 
> can't
> we just compile D code to C, as a compiler output, and then run 
> that
> through Emscripten?

The [D language runtime][1] uses inline assembly for some 
low-level features (e.g., threads), and therefore cannot be 
compiled to C.

Emscripten itself has [similar limitations.][2]

[1]: https://github.com/dlang/druntime/
[2]: 
https://emscripten.org/docs/porting/guidelines/portability_guidelines.html#code-that-cannot-be-compiled


More information about the Digitalmars-d mailing list