surviving wasm

ryuukk_ ryuukk.dev at gmail.com
Thu Dec 14 10:06:57 UTC 2023


On Wednesday, 13 December 2023 at 20:40:20 UTC, monkyyy wrote:
> so long term planning on wasm raylib; I want compatibility with 
> the good parts of the std, the std is causal about using libc 
> while ldc-wasm half-baked implication is missing a bunch of 
> basically worthless symbols but given the std is 1 million 
> lines of code it will be a perennial problem that I make 
> something work natively, I try it in wasm, it breaks citing a 
> random core lib at a random line; the options I know about are:
>
> 1. use a "team betterc" personal std that doesn't have the apis 
> I want, apis I know and probably limited
> 2. merge "use libc less" upstream to a std that has been slow 
> to merge changes and probably doesnt care about wasm
> 3. fork the std
> 4. maintain patches to the std that go in and rewrite them live 
> with root :D what could go wrong
> 5. make my own personal std that matches the std api of the 
> parts I use
>
> I hate all these options

there is no libc on WASM, you'll either have to use WASI or 
emscripten

emscripten was made for this specific case, so you don't have to 
worry about anything

https://theartofmachinery.com/2018/12/20/emscripten_d.html


I personally started from scratch, so i only pay for what i use, 
and carefully craft my own std/runtime, and it's the way to go 
imo, just like i'd do in C, but with the advantage of using a 
better language (D)


More information about the Digitalmars-d-learn mailing list