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.
3. What is Web Assembly AbouT ?
Compilation?
Cross-language Web ?
Performance ?
Mozilla baby ? JavaScript Death ?
Obfuscated Code ?
Very Limited scope ?
6. 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
7. Languages
Browser supported extensions / plugins with APIs like
XUL, XPCOM
NAPI (Netscape Plugin Application Programming Interface)
PPAPI (Pepper Plugin API)
8. 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
11. Raise of Web Applications
● GMail / Google Maps
● Shopping Apps like eBay
● Back / Front Offices
● Games
12. 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
13. HTML5
Storage / IndexedDB / Web SQL
Canvas / WebGL
Web Sockets
Web workers
Typed Arrays
Blob / ArrayBuffer / ArrayBufferView
19. 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
20. 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
22. Web Assembly
.wasm files generated by EMScripten from C code
Binary format
Dedicated minimal Syntax Tree
Faster Parsing
Debuggable via a textual representation (.wast)
27. SIMD
Supported by Intel chips
in Dart in 2013
in V8 (Chrome) & SpiderMonkey (Firefox)
Finally rejected from ECMAScript
Moving to Web Assembly engine
28. Shared Array BufFer
Allocates a shared memory
Accessible from many windows, iframes, workers
clones vs direct references
Accessible from WebGL Contexts
30. 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)
31. 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, ...
32. 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 ?
33. 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…
34. What FOR ?
Image Decoders
Video codecs
Encrypted Media Extension (DRMs)
Augmented Reality
Machine Learning
...
35. All used in Web Application from...
...JavaScript