D and WebAssembly (Wasm)
Kenneth Dallmann
fake at 123.con
Mon Sep 13 16:42:12 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]
>
> [1]: https://github.com/dlang/druntime/
> [2]:
> https://emscripten.org/docs/porting/guidelines/portability_guidelines.html#code-that-cannot-be-compiled
Inline assembly is described here for the C language.
https://en.cppreference.com/w/c/language/asm#:~:text=Inline%20assembly%20(typically%20introduced%20by,as%20an%20extension%20in%20C.
More information about the Digitalmars-d
mailing list