Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interop with JS APIs is a requirement. Therefore, glue code is a requirement. If we’re not going to get direct access to the DOM, can we at least get the ability to just list the JS functions that our wasm will call? Of course the list will be bundled with (compiled into) the wasm blob, and whether it’s literally a text list or something like a registration call naming those JS functions, I am agnostic about. Everyone having to write all their own glue[*] is just nuts at this point.

[*]Yeah, the toolchains help solve this a bit, but it still makes me ship JS and wasm side-by-side.



> If we’re not going to get direct access to the DOM, can we at least get the ability to just list the JS functions that our wasm will call?

You mean like a list of JS functions that are imported into the Wasm binary? This has been there since day one:

    (module
        ...
        (import "env" "foo" (func (;0;) (type 1)))
        (import "env" "bar" (func (;1;) (type 2)))
        ...
    )
> Everyone having to write all their own glue[*] is just nuts at this point.

Did you mean for the specific programming language you use? If so then that seems like a problem for the language implementor, not a problem with Wasm. Rust has wasm bindgen, Emscripten has their thing, and so on.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: