Server-side Web Assembly Horacio Gonzalez 2021-06-24
Slide 2
Who are we? Introducing myself and introducing OVH OVHcloud
Slide 3
Horacio Gonzalez @LostInBrittany Spaniard lost in Brittany, developer, dreamer and all-around geek
Flutter
Slide 4
OVHcloud: A global leader Web Cloud & Telcom
30 Data Centers in 12 locations
1 Million+ Servers produced since 1999
Private Cloud
34 Points of Presence on a 20 TBPS Bandwidth Network
1.5 Million Customers across 132 countries
Public Cloud
2200 Employees worldwide
3.8 Million Websites hosting
Storage
115K Private Cloud VMS running
1.5 Billion Euros Invested since 2016
300K Public Cloud instances running
P.U.E. 1.09 Energy efficiency indicator
380K Physical Servers running in our data centers
20+ Years in Business Disrupting since 1999
Network & Security
Slide 5
Did I say WebAssembly? Wasm for friends…
Slide 6
WebAssembly, what’s that?
Slide 7
A low-level binary format
Not a programming language, a compilation target
Slide 8
That runs on a stack-based virtual machine
A portable binary format that runs on all modern browsers… but also on NodeJS and elsewhere!!
Slide 9
With several key advantages
Slide 10
But above all…
Wasm is not meant to replace JavaScript
Slide 11
Who is using WebAssembly today?
And many more others…
Slide 12
A bit of history Remembering the past to better understand the present
Slide 13
Executing other languages in the browser
A long story, with many failures…
Slide 14
2012 - From C to JS: enter emscripten
Passing by LLVM pivot
Slide 15
2013 - Generated JS is slow…
Let’s use only a strict subset of JS: asm.js Only features adapted to AOT optimization
Slide 16
WebAssembly project
Joint effort
Slide 17
Server-side WebAssembly Too good to not to use it
Slide 18
Solomon on Web Assembly
Slide 19
Solomon on Web Assembly
Slide 20
A very interesting feature set
Slide 21
Features of Wasm Why is everybody looking at it?
Slide 22
Near native speed
https://medium.com/wasmer/benchmarking-webassembly-runtimes-18497ce0d76e
Slide 23
Highly portable
It can be run almost everywhere…
Slide 24
Readable and debuggable
Each .wasm file with it .wat companion file
Slide 25
Memory safe & secure
Running in a fully sandboxed environment
Slide 26
Accepting many source languages
And more and more…
Slide 27
Still a young platform… But growing up fast!
Slide 28
Native WASM types are limited WASM currently has four available types: ● ● ● ●
i32: 32-bit integer i64: 64-bit integer f32: 32-bit float f64: 64-bit float
Types from languages compiled to WASM are mapped to these types
Slide 29
How can we share data?
Using the same data in WASM and JS? Shared linear memory between them, and serializing the data to one Wasm types
Slide 30
Solution is coming: Interface types
Beautiful description at: https://hacks.mozilla.org/2019/08/webassembly-interface-types
Slide 31
No outside access
By design, communication is done using the shared linear memory only
Slide 32
Solution exists: WASI
Slide 33
Mono-thread and scalar operations only
Not the most efficient way…
Slide 34
Solution exists: SIMD
Slide 35
Solutions are coming too: Wasm Threads
Threads on Web Workers with shared linear memory
Slide 36
Incoming proposals: Garbage collector
And exception handling
Slide 37
The Bytecode Alliance Taking WASM out of the browser
Slide 38
The Bytecode Alliance
Slide 39
Bytecode Alliance projects
Slide 40
Wasmtime
Slide 41
Cranelift
Slide 42
WebAssembly Micro Runtime (wamr)
Slide 43
Lucet
Slide 44
Other runtimes Runtimes, runtimes everywhere
Slide 45
Wasmer
Run any code* on any client… almost * Languages compiling to WASM
Slide 46
Wasmer
Slide 47
Wasmer ecosystem
Slide 48
Wasmer ecosystem
Slide 49
Wasm3
Slide 50
Wasm3
Slide 51
And even Wasm over GraalVM!
Slide 52
Or in Kubernetes…
Slide 53
Some examples IRL? Like companies using these things