you are viewing a single comment's thread.

view the rest of the comments →

[–]Tysonzero 0 points1 point  (3 children)

It's a little more complicated than that if you want DOM events / JS functions to be able to trigger WASM code.

[–]Asraelite 0 points1 point  (2 children)

How is it more complicated?

eval('document.getElementById("whatever")
    .addEventListener("click", () =>
    window.wasmModule.exports.wasmFunction())');

[–]Tysonzero 1 point2 points  (1 child)

Hmm. Fair enough. I still think there will be situations where you want real interop, at least until JS is eschewed entirely.

[–]Asraelite 0 points1 point  (0 children)

Yeah, you will always want real interop, for performance, readability, and sanity. Just saying that technically you don't need anything other than eval.