Successfully reported this slideshow.
Your SlideShare is downloading. ×

Asyncifying WebAssembly for the modern Web

Ad

Asyncifying WebAssembly
Ingvar Stepanyan (@RReverser)
WebAssembly Developer Advocate @ Google

Ad

Simple WebAssembly

Ad

Simple WebAssembly

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Loading in …3
×

Check these out next

1 of 54 Ad
1 of 54 Ad

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.

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.

Advertisement
Advertisement

More Related Content

Advertisement

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

×