On Thursday, 6 July 2017 at 22:58:36 UTC, Ola Fosheim Grostad
wrote:
On Thursday, 6 July 2017 at 18:26:18 UTC, Joakim wrote:
so you can seamlessly pass objects to javascript. I believe
people have written their own GCs that target webasm, so the D
GC can likely be made to do the same.
You would have to emulate the stack...
WebAssembly has linear memory that you can scan just like normal
memory. C programs use it for those values on the stack that it
needs a pointer to. For other values they are put on the safe
stack, you can only read the value not the memory backing it.
So there is a problem of pointers going on the safe stack so you
need to make sure to not optimise those pointers to the safe
stack.
But in short, the D GC will work just fine, just need to be a bit
carefull with pointers on the stack.
Cheers, Jakob.