godot-dlang now has experimental web export support

evilrat evilrat666 at gmail.com
Sun Jun 29 08:26:09 UTC 2025


godot-dlang (a GDExtension interface library that lets you write 
D scripts for godot) now has very basic and extremeeeeeely 
experimental Web export support, this means you can now export 
simple projects written in D to run in browser. That is being 
said, while simple, it does not mean compact because godot itself 
can be treated as full OS in this case.

This is still in its very early stage, there is lots of things 
missing, but hey it is here!

Github
https://github.com/godot-dlang/godot-dlang

Link to a readme
https://github.com/godot-dlang/godot-dlang/blob/master/WEBEXPORT.md

Thanks to Adam Ruppe (https://github.com/adamdruppe) and Marcelo 
Silva Nascimento Mancini (https://github.com/MrcSnm) for their 
amazing work on minimal D runtime for WASM!

---

a bit more techy details

In its core lies a minimal D runtime implementation that makes it 
possible to run full (well, almost) D subset in browser.
Being minimal, means there is no GC (WASM currently has no way 
running a GC scannable memory in any case), it does leaky 
allocations and other sloppy things but the project tries to 
minimize them to be able to do a long runs without running OOM.
Also since phobos is build with GC in mind some things will be 
tricky to use and generally using phobos should be avoided in 
favor of using built-in godot functions (luckily there is a lot 
of stuff).
Since WASM itself is just a low level virtual machine, it does 
not provides any system interfaces(we are not talking about WASI 
here which aims to be mostly compatible with POSIX), instead we 
rely on emscripten(which is yet another POSIX compatibility 
thing) which is what upon godot builds on for its web export, it 
provides traditional libc environment which we utilize for tasks 
like memory allocation.
Another difference between "normal" WASM and emscripten is that 
in WASM a program is self contained, basically a plain .exe/unix 
executable, while in emscripten it emulates the whole dynamic 
linking process.
While it is not impossible to target WASI directly and avoiding 
extra bloat I ain't no expert in WASM and not willing to spent 
months(if not years) on approaching that task.

That's all, thanks.




More information about the Digitalmars-d-announce mailing list