Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Asyncifying WebAssembly
Ingvar Stepanyan (@RReverser)
WebAssembly Developer Advocate @ Google
Simple WebAssembly
Simple WebAssembly
WebAssembly with I/O
WebAssembly with I/O
WebAssembly with I/O
WebAssembly with I/O
WebAssembly with I/O
fread on the Web?
fread
In-memory
storage
localStorage IndexedDB
Network
storage
Native File
System
fread on the Web?
fread
In-memory
storage
localStorage IndexedDB
Network
storage
Native File
System
Asynchronous Web I/O
Asynchronous Web I/O
JavaScript event loop
JavaScript event loop
JavaScript event loop
JavaScript event loop
JavaScript event loop
JavaScript event loop
Blocking code
Blocking code
Blocking code
Blocking code
WebAssembly with I/O
WebAssembly with I/O
WebAssembly with I/O
WebAssembly with I/O
WebAssembly with I/O
WebAssembly with async I/O
WebAssembly with async I/O
WebAssembly with async I/O
WebAssembly with async I/O
Using Asyncify
Using Asyncify
Using Asyncify
Using Asyncify
Using Asyncify
Using Asyncify
Using Asyncify
Using Asyncify
Using Asyncify
Using Asyncify
•
•
•
Standalone JavaScript wrapper
https://github.com/GoogleChromeLabs/asyncify
•
•
•
Using Asyncify
fread on the Web!
fread
In-memory
storage
localStorage
Network
storage
IndexedDB
Native File
System
fread on the Web!
fread
In-memory
storage
localStorage
Network
storage
IndexedDB
Native File
System
fread on the Web!
fread
In-memory
storage
localStorage
Network
storage
IndexedDB
Native File
System
fread on the Web!
• https://twitter.com/RReverser/status/1221863135881187329
libusb on the Web!
libusb on the Web!
• https://twitter.com/RReverser/status/1306307329802080256
Asyncify downsides
Asyncify downsides
Future solutions
https://github.com/WebAssembly/design
Useful links
• Asyncify announcement post:
https://kripken.github.io/blog/wasm/2019/07/16/asyncify.html
• Asyncify Emscrip...
Asyncifying WebAssembly for the modern Web
Asyncifying WebAssembly for the modern Web
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
What to Upload to SlideShare
Next
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

Share

Asyncifying WebAssembly for the modern Web

Download to read offline

WebAssembly is great as a target for a low-level code, but in order to do something useful, it needs to interact with the outer world. On the Web, this means performing all sorts of I/O through Web APIs, and here comes the challenge: they are designed to be asynchronous, but WebAssembly is not.


Let's take a look at this problem and see how it can be fixed, as well as at some examples we can build by combining power of both modern Web APIs and a fast native compilation target.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Asyncifying WebAssembly for the modern Web

  1. 1. Asyncifying WebAssembly Ingvar Stepanyan (@RReverser) WebAssembly Developer Advocate @ Google
  2. 2. Simple WebAssembly
  3. 3. Simple WebAssembly
  4. 4. WebAssembly with I/O
  5. 5. WebAssembly with I/O
  6. 6. WebAssembly with I/O
  7. 7. WebAssembly with I/O
  8. 8. WebAssembly with I/O
  9. 9. fread on the Web? fread In-memory storage localStorage IndexedDB Network storage Native File System
  10. 10. fread on the Web? fread In-memory storage localStorage IndexedDB Network storage Native File System
  11. 11. Asynchronous Web I/O
  12. 12. Asynchronous Web I/O
  13. 13. JavaScript event loop
  14. 14. JavaScript event loop
  15. 15. JavaScript event loop
  16. 16. JavaScript event loop
  17. 17. JavaScript event loop
  18. 18. JavaScript event loop
  19. 19. Blocking code
  20. 20. Blocking code
  21. 21. Blocking code
  22. 22. Blocking code
  23. 23. WebAssembly with I/O
  24. 24. WebAssembly with I/O
  25. 25. WebAssembly with I/O
  26. 26. WebAssembly with I/O
  27. 27. WebAssembly with I/O
  28. 28. WebAssembly with async I/O
  29. 29. WebAssembly with async I/O
  30. 30. WebAssembly with async I/O
  31. 31. WebAssembly with async I/O
  32. 32. Using Asyncify
  33. 33. Using Asyncify
  34. 34. Using Asyncify
  35. 35. Using Asyncify
  36. 36. Using Asyncify
  37. 37. Using Asyncify
  38. 38. Using Asyncify
  39. 39. Using Asyncify
  40. 40. Using Asyncify
  41. 41. Using Asyncify • • • Standalone JavaScript wrapper https://github.com/GoogleChromeLabs/asyncify • • •
  42. 42. Using Asyncify
  43. 43. fread on the Web! fread In-memory storage localStorage Network storage IndexedDB Native File System
  44. 44. fread on the Web! fread In-memory storage localStorage Network storage IndexedDB Native File System
  45. 45. fread on the Web! fread In-memory storage localStorage Network storage IndexedDB Native File System
  46. 46. fread on the Web! • https://twitter.com/RReverser/status/1221863135881187329
  47. 47. libusb on the Web!
  48. 48. libusb on the Web! • https://twitter.com/RReverser/status/1306307329802080256
  49. 49. Asyncify downsides
  50. 50. Asyncify downsides
  51. 51. Future solutions https://github.com/WebAssembly/design
  52. 52. Useful links • Asyncify announcement post: https://kripken.github.io/blog/wasm/2019/07/16/asyncify.html • Asyncify Emscripten docs: https://emscripten.org/docs/porting/asyncify.html • Binaryen toolchain: https://github.com/WebAssembly/binaryen • Standalone Asyncify wrapper: https://github.com/GoogleChromeLabs/asyncify • WebAssembly design discussions: https://github.com/WebAssembly/design

WebAssembly is great as a target for a low-level code, but in order to do something useful, it needs to interact with the outer world. On the Web, this means performing all sorts of I/O through Web APIs, and here comes the challenge: they are designed to be asynchronous, but WebAssembly is not. Let's take a look at this problem and see how it can be fixed, as well as at some examples we can build by combining power of both modern Web APIs and a fast native compilation target.

Views

Total views

593

On Slideshare

0

From embeds

0

Number of embeds

32

Actions

Downloads

4

Shares

0

Comments

0

Likes

0

×