DMD Frontend working in WebAssembly

Sebastiaan Koppe mail at skoppe.eu
Fri Oct 15 14:28:45 UTC 2021


On Friday, 15 October 2021 at 11:52:24 UTC, hatf0 wrote:
> Very cool! This all would not be possible with your wasm
> forks -- they are the saving grace here.

Nice that you got it running.

> GC also needs some investigation (or malloc), as I keep get 
> spurious OOM errors. Could be because dmd is one hell of a 
> memory hog, but who knows.

So far I haven't hit those when running druntime/phobos tests, 
but they could be caused by pointers being hidden from GC because 
they sit on the wasm stack/registers.

The only way to solve that would be to (somehow) have LDC put 
them on the shadow stack whenever they aren't. I know of some 
experiments where they did this with a boehm style GC on 
emscripten. Maybe I need to look more into how other languages 
(like go) handle this.


More information about the Digitalmars-d-announce mailing list