Surfing on wave.. WASM

KnightMare black80 at bk.ru
Mon May 27 15:30:46 UTC 2019


On Monday, 27 May 2019 at 14:38:00 UTC, Adam D. Ruppe wrote:
> On Monday, 27 May 2019 at 14:01:46 UTC, JN wrote:
>> Do you know how plausible it would be to ever enable
>> WASM for non BetterC code?
>
> It is more tedious than it is difficult, but I think real 
> usefulness is kinda blocked on stuff from the wasm side 
> (interop with the real world) and on the D compiler side 
> (efficient small code).

proxies of outer objects in wasm space will solve interop from 
inside.
in case of nonmoveable GC in WASM host can invoke inside objects 
directly (we had ref to it somehow).
in both cases JIT/dynamicCompilation(as in LDC) will be very 
helpful.

GC will appear in WASM in some future. most probably with 
compact/move ability.
so access to object need to pin object first. its not native 
Dlang behavior.

in case Dlang community will write GC/RT for WASM interop can be 
10x faster and whole bundle will be most independent for 
development. and Dlang progs can host WASM as VM/script engine.

so next things are desirable:
- platform independent RT. most probably in some bytecode style 
(LLVM-IR?). versioned (as I described in few hours ago).
- dynamic codegeneration and compilation, JIT (LLVM will helps 
too)
with 2 such things Dlang will rise to heaven - scripting, 
protocol adapters, dynamically types interop, serialization from 
and to different formats, so formatters, ORM in runtime with 
schemas from DB-connection, GUI scripts as QML...
(and we will get C#? :) )


More information about the Digitalmars-d mailing list