D and WebAssembly (Wasm)

Denis Feklushkin denis.feklushin at gmail.com
Wed Sep 15 07:17:30 UTC 2021


On Monday, 13 September 2021 at 16:36:28 UTC, Paul Backus wrote:
> 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]

Time to remind everyone about my project: 
https://github.com/denizzzka/d_c_arm_test

It just allows to take these things into a small "backend":
https://github.com/denizzzka/d_c_arm_test/tree/master/d/freertos_druntime_backend/external

It is possible to write same backend for webasm or any other 
platform.

(But now there is a tiny problem with the Meson, which does not 
allow to package arbitrary dub and any others repositories into 
Meson. PR is waiting for approval.)



More information about the Digitalmars-d mailing list