Re: WASM Host Bindings proposal docs

Thanks for the pointers Kai!

In the host bindings proposal, it looks like we could pass string to
functions both as C strings (memory offset + size) or a DOMString wrapped
in an anyref. If the choice between the two is left to the WebAssembly
module and supporting code, then it could choose to use DOMStrings wrapped
in anyref to take advantage of the AtomicString optimization. This is a bit
scary though because it might perform worse than C-strings on browsers that
don't have the optimization. The alternative is that WebGPU describes which
is the import binding structure is the most efficient for its entry points.

The host binding proposal doesn't address dictionaries though (except for
the JSON string argument type) so we should ask the WASM CG what the
options would be there.

On Tue, Mar 6, 2018 at 5:12 PM, Kai Ninomiya <kainino@google.com> wrote:

> Hey all,
>
> I don't think these have been shared here (I only just actually learned
> that there were published up-to-date proposals).
>
> Draft Reference Types proposal (add an "anyref" type to WASM which
> references opaque objects outside WASM):
> https://github.com/WebAssembly/reference-types/blob/master/proposals/
> reference-types/Overview.md
>
> Draft Host Bindings proposal (relies on "anyref" for host binding calls):
> https://github.com/WebAssembly/host-bindings/blob/master/proposals/host-
> bindings/Overview.md
>
> My understanding from a brief chat with Brad Nelson, just now, is that the
> anyref objects can be held directly from WASM - avoiding
> host-binding-call-time table lookups (lookups in the WebAssembly.Table).
>

Received on Wednesday, 7 March 2018 20:14:53 UTC