3 ms·
An important question for any WASM language is: what's JS interop like? The raw interop features are extremely primitive, so you really need something ergonomi
by brundolf 6y ago
An important question for any WASM language is: what's JS interop like?
The raw interop features are extremely primitive, so you really need something ergonomic built on top of them. Rust's wasm-bindgen combined with some Traits shenanigans gets you something decent. A language designed specifically for WASM seems like the perfect opportunity to provide an exceptional story for this, but I don't see anything about it in the OP (only skimmed so could have missed it). Does Grain have a story here?
- jillesvangurp 6y agoI'd say this is more a matter of browsers and WASM specs gradually improving and not something a language/compiler should try to do separately. This is ongoing work and basically there are quite a few things roadmapped/coming that are relevant. As that stuff lands, the entire ecosystem will get more usable. JS interop is short term a bit annoying, depending on what you are doing. But at this point plenty of non trivial things are being done with WASM that are finding their way into e.g. Figma, or bits and pieces of popular frameworks like react or web frameworks in Rust or other languages that manipulate the DOM, do things with WebGL, etc. So, yes, there is room for improvement but it's not completely horribly unusable right now.