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.

Past, present, and future of web assembly - Devfest Nantes 2017

446 views

Published on

The Web Assembly innovation is now supported by all modern browsers. Some people see in it a way to develop on the web without JavaScript while others are quite excited by the performance promise.To better understand what this technology is about, I invite to a journey from its origins to the present and will propose you a vision of concrete impacts it can have in the very next years.

Published in: Technology
  • Be the first to comment

Past, present, and future of web assembly - Devfest Nantes 2017

  1. 1. Past, Present, and Future of Web Assembly Alexandre Morgaut
  2. 2. What is Web Assembly AbouT ? Compilation? Cross-language Web ? Performance ? Mozilla baby ? JavaScript Death ? Obfuscated Code ? Very Limited scope ?
  3. 3. PAST some sub content
  4. 4. Languages
  5. 5. Languages HTML 4.01 mentions JS, VB & TCL as script languages WebIDL only exposed the Java language binding for Web Standards Internet Explorer supported JScript & VB
  6. 6. Languages Browser supported extensions / plugins with APIs like XUL, XPCOM NAPI (Netscape Plugin Application Programming Interface) PPAPI (Pepper Plugin API)
  7. 7. Languages <object> & <embed> were used to run Applets written in Java ActiveX written in VB, C++, or Delphi Quicktime potentially with AppleScript code Flash clips using ActionScript code
  8. 8. Web Apps
  9. 9. Raise of Web Applications ● GMail / Google Maps ● Shopping Apps like eBay ● Back / Front Offices ● Games
  10. 10. Web Applications Standards ● Web Standards Project ○ ACID 1, 2, and 3 Tests checking HTML, CSS, and then JS ● The Web Hypertext Application Technology Working Group (WHATWG) ● HTML5 / CSS3 ● ECMAScript 5
  11. 11. HTML5 Storage / IndexedDB / Web SQL Canvas / WebGL Web Sockets Web workers Typed Arrays Blob / ArrayBuffer / ArrayBufferView
  12. 12. Installable Offline Support Service Workers Manifests
  13. 13. Desktop Applications Electron & NW.js ● Node.js ● Blink
  14. 14. Transpilers
  15. 15. Transpilers ● GWT (Google Web Toolkit) ● CoffeeScript ● Dart / TypeScript ● EMScripten > SourceMap
  16. 16. Sourcemap Map running JavaScript code instruction to the source code lines and columns The JavaScript debuggers shows your original code
  17. 17. EMscripten Presented in 2009 by Alon Zakai Compiles C libraries into JavaScript code Already gave very impressive performances Creates in-browser file system using HTML5 technologies Already optimize code for JiT compilers
  18. 18. ASM.JS Launched by Mozilla after they recruted Alon Zakai EMScripten generates more optimised JS code "use asm" Pragma in functions to define asm modules V8 didn't officially support it but kind of auto recognize asm like patterns > Unity 3D engine Mozilla demos https://blogs.unity3d.com/2014/04/29/on-the-future-of-web-publishing-in-unity
  19. 19. PRESENT some sub content
  20. 20. Web Assembly .wasm files generated by EMScripten from C code Binary format Dedicated minimal Syntax Tree Faster Parsing Debuggable via a textual representation (.wast)
  21. 21. .wast textual representation
  22. 22. JavaScript usage https://www.slideshare.net/llamerada-jp/webassembly-75175349
  23. 23. JavaScript vs Web Assembly https://hacks.mozilla.org/2017/02/what-makes-webassembly-fast/
  24. 24. SIMD - Single Instruction, multiple data
  25. 25. SIMD Supported by Intel chips in Dart in 2013 in V8 (Chrome) & SpiderMonkey (Firefox) Finally rejected from ECMAScript Moving to Web Assembly engine
  26. 26. Shared Array BufFer Allocates a shared memory Accessible from many windows, iframes, workers clones vs direct references Accessible from WebGL Contexts
  27. 27. Future some sub content
  28. 28. JavaScript extensions Many scripting languages allows usage of C written module JavaScript only allowed it from Node.js Expect to see many of them either ● on npm (like jquery plugins) ● on a dedicated repository like PECL (PHP Extension Community Library)
  29. 29. Upcoming languages Web Assembly is not limited to C code source There is already some Rust to wasm demos There is also some Swift experiences We can expect Dart, Objective C, Go, ...
  30. 30. Upcoming languages As said Brendan Eich "Do not expect JavaScript support any time soon" Scripting languages === Poor candidates Forget also PHP, Python or Ruby ? What about TypeScript ?
  31. 31. Assemblyscript Created from TypeScript TypeScript being itself a flavor very similar to JavaScript Opportunity for JS dev to write Web Assembly modules Why not a direct TypeScript to Web Assembly in the future…
  32. 32. What FOR ? Image Decoders Video codecs Encrypted Media Extension (DRMs) Augmented Reality Machine Learning ...
  33. 33. All used in Web Application from... ...JavaScript
  34. 34. Questions ?
  35. 35. Thank you Alexandre Morgaut @amorgaut

×