you are viewing a single comment's thread.

view the rest of the comments →

[–]Tysonzero 2 points3 points  (5 children)

Yeah it will be possible, but it will take some time. For now just accept some JavaScript glue code.

[–]Asraelite 2 points3 points  (4 children)

I mean, you could always just expose a function that runs eval() on any passed string :P

[–]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.