Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

IndexedDb and XHR #16

Closed
artem-v-shamsutdinov opened this issue Oct 1, 2018 · 4 comments
Closed

IndexedDb and XHR #16

artem-v-shamsutdinov opened this issue Oct 1, 2018 · 4 comments

Comments

@artem-v-shamsutdinov
Copy link

Hello,

Thank you for the work on this proposal! I'm very much looking forward to it's implementation (it is my understanding that this will make browser I/O much faster).

I have a few of questions:

Will support for IndexedDb be included?
Will support for XHR (or it's modern incarnation) be included?
What is the status of this proposal (there haven't been any activity on the repository for almost a year)?

Again, thank you very much for your time and effort!

@lukewagner
Copy link
Member

Will support for IndexedDb be included?

No; this was considered for a while and removed. Multiple browsers are working on implicit caching of wasm machine code based on the HTTP cache.

Will support for XHR (or it's modern incarnation) be included?

You can XHR to get an ArrayBuffer and WebAssembly.instantiate(buffer) today. For a more modern and efficient incantation, you can WebAssembly.instantiateStreaming(fetch(url)), although not all browsers support yet.

What is the status of this proposal (there haven't been any activity on the repository for almost a year)?

After the reference types proposal was factored out, we've been actively working on that proposal. The main remaining problems to be solved in the Host Bindings proposal, once we have reference types, all concern removing the remaining cases where we unnecessarily need JS wrapper glue, allowing wasm to:

  • pass and receive receiver ("this") arguments (allowing methods/getters/setters)
  • call and be called as if by new
  • when passing a value to JS, interpret an i32/i64 as unsigned when converting to Number/BigInt

There's a lot more potential optimizations, but I imagine something like the above forming a "Host Bindings MVP". We should be discussing this at TPAC (or before) and updating the Proposal.md appropriately after that.

@Pauan
Copy link

Pauan commented Oct 1, 2018

@lukewagner To be clear, they're not talking about caching the WebAssembly instance/module, they're talking about using the IndexedDB API inside of a program which has been compiled to wasm.

Right now this requires wasm to import some JS shims, and then the JS shims use the IndexedDB API, but the host bindings proposal would allow wasm to call the IndexedDB APIs directly.

@lukewagner
Copy link
Member

Ah, gotcha. Yes, then for that purpose you'd want reference types and the ability to call a method.

@artem-v-shamsutdinov
Copy link
Author

Understood. Thank you very much for your time in answering these questions.

lukewagner added a commit that referenced this issue Nov 22, 2021
Sync Explainer.md with Binary.md, add a Subtyping.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants