Hacker News new | ask | show | jobs
by daurnimator 3051 days ago
> Some folks are rubbing their hands together about the possibility of using the DOM in another language and not writing JavaScript; this will eventually happen

Sadly WASM doesn't help here at all due to lack of way to interact with the GC. Not only lack of finalisers but that having two GCs doesn't work. I learnt this 2 times over the hard way.

For something today, look to fengari: https://fengari.io/ . It implements a VM in javascript, reusing the javascript garbage collector, which means that you get seamless DOM interaction.

2 comments

GC interaction is not needed for DOM stuff. That was originally the case, but the "host bindings" proposal lets it shed that dependency. I pasted a link downthread.
In time. Model the WASM code as a WebWorker, use the DOM like you would in React. A semantic level shadow DOM in WASM is lightweight.

WASM is a beautiful baby universe, hatched from a messy past.