Comment by jech

Comment by jech 2 months ago

4 replies

> The DOM has been designed as a JS API

My understanding is that it originated as a straight binding to Netscape Navigator's C++ API, so it's actually originally a C++ API.

flohofwoe 2 months ago

Calling an "idiomatic" C++ API from WASM would also require a (COM like) shim though since C++ has no standardized ABI. E.g. as soon as your API uses things like std::string it already gets hairy.

  • weinzierl 2 months ago

    There already is browser.wit, that is what a direct interface could look like.

    • pjmlp 2 months ago

      But this is what flohofwoe was talking about, WIT is basically COM/CORBA/RMI/Remoting for WebAssembly.

    • flohofwoe 2 months ago

      Yes, but in the end this just automates the bindings generation, runtime overhead for marshalling will be the same.