Status of WASM support?
alexandru.ermicioi at gmail.com
Sat Aug 1 08:42:49 UTC 2020
On Friday, 31 July 2020 at 21:18:25 UTC, Sebastiaan Koppe wrote:
> On Friday, 31 July 2020 at 16:23:16 UTC, JN wrote:
>> What is the recommended way to roll a D app running in a web
>> browser at the moment? Spasm or something else? Last time I
>> remember Spasm could only allocate memory but couldn't
>> deallocate it, has it changed since then?
> There is no reason why you can't deallocate, since it is just
> plain old manual memory management. The wasm allocator follows
> the stdx allocator so you can build on that.
> I did experiment with a GC last year but I abandoned that in
> favor of porting druntime to wasm. The problems I ran into were
> mostly because 'new' isn't templated, so no amount of work I
> did would allow people to simply 'new' things, and instead they
> would always be stuck with custom allocators. Which is fine for
> some, but it is really barebones.
I've been wondering, is it possible to make gc take an allocator
for memory allocation, instead of manually querying OS for that?
If it is possible, then it would make possible to use new in
wasm, by just passing wasm allocator to it.
More information about the Digitalmars-d