DMD Frontend working in WebAssembly
hatf0
harrison at 0xcc.pw
Fri Oct 15 11:52:24 UTC 2021
On Friday, 15 October 2021 at 07:28:55 UTC, Sebastiaan Koppe
wrote:
> On Thursday, 14 October 2021 at 22:58:37 UTC, hatf0 wrote:
>> On Thursday, 14 October 2021 at 22:56:07 UTC, hatf0 wrote:
>>> Hi all,
>>>
>>> I've just managed to get the full DMD front-end to work in
>>> WebAssembly (with skoppe's druntime fork).
>
> Cool stuff. I recently picked up my wasm forks again and
> updated to wasi 12, ldc 1.25.0 and the accompanying
> druntime/phobos versions and got all tests to pass (those that
> I didn't version out). I am currently in the process of
> updating to latest ldc and latest druntime/phobos. Phobos has a
> bunch of merge conflicts, but it should be doable if I find a
> few hours.
> Then there is the process of upstreaming a 5000+ line patch and
> I probably need some help there. I reckon the WASI bindings are
> pretty standalone so those should be easy to add, but there is
> a sprawl of additions across almost all files due to not
> supporting threads, fibers and catching exceptions.
Very cool! This all would not be possible with your wasm forks --
they are the saving grace here.
Regarding upstreaming the patch... that will be rather
challenging, but I would not mind contributing. I definitely
think the WASI bindings (if not all of the files in
`core.sys.wasi.*`) should be upstreamed first, as they're the
simplest to implement, and then the various druntime patches
should follow.
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.
More information about the Digitalmars-d-announce
mailing list