Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rust and WebAssembly for the masses
Search
Sendil Kumar N
February 05, 2020
Technology
1
100
Rust and WebAssembly for the masses
Sendil Kumar N
February 05, 2020
Tweet
Share
More Decks by Sendil Kumar N
See All by Sendil Kumar N
[Heapcon-2023] Building High Performance Web Applications
sendilkumarn
0
71
Building Reactive Microservices with Kotlin & running on Kubernetes
sendilkumarn
0
150
Building Reactive Microservices with JHipster & K8s
sendilkumarn
0
18
Designing High Performance React Applications
sendilkumarn
1
140
Batching, Suspense, and Server Components
sendilkumarn
0
33
DevNexus_Building_with__Zero_Trust_Architecture_Copy.pdf
sendilkumarn
0
55
Lessons Learnt with Visual Testing and Snapshots
sendilkumarn
0
100
Easy Microservices with K8s & Istio
sendilkumarn
0
85
KHipster - Kotlin Hipster
sendilkumarn
0
210
Other Decks in Technology
See All in Technology
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
Lexical Analysis
shigashiyama
1
150
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
170
OS 標準のデザインシステムを超えて - より柔軟な Flutter テーマ管理 | FlutterKaigi 2024
ronnnnn
1
290
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
760
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
190
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
310
Storybook との上手な向き合い方を考える
re_taro
1
220
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
130
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
How GitHub (no longer) Works
holman
310
140k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Fireside Chat
paigeccino
34
3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Being A Developer After 40
akosma
87
590k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Transcript
@sendilkumarn Hej! Stockholm
@sendilkumarn Every progra!"ing language has trade-offs. Choose one that solves
your problem, not creates one.
Rust and WebAssembly Sendil Kumar N
@sendilkumarn Sendil Kumar
@sendilkumarn
@sendilkumarn Netherlands
@sendilkumarn Senior Software Engineer @uber
@sendilkumarn Passionate about Open Source Senior Software Engineer @uber
@sendilkumarn Passionate about Open Source Senior Software Engineer @uber Team
member @JHipster
@sendilkumarn Passionate about Open Source Senior Software Engineer @uber Team
member @JHipster Hacking on WebAssembly
What is WASM? How WASM helps? DEMO Why Rust? Rust
and WASM DEMO WASM Roadmap Agenda @sendilkumarn
WebAssembly @sendilkumarn
Yet Another Frontend framework?
@sendilkumarn 00 61 73 6D 01 00 00 00 Native
Code WebAssembly Binary JavaScript Javascript Engine
@sendilkumarn func add is called Stack get_local $lhs LHS RHS
get_local $rhs i32.add SUM Structured stack machine
@sendilkumarn 00 61 73 6D 01 00 00 00 Size
& Load time efficient
@sendilkumarn Native Speed 00 61 73 6D 01 00 00
00
@sendilkumarn madewithwebassembly.com
Why not JavaScript? @sendilkumarn
JavaScript is awesome @sendilkumarn
JavaScript is easy @sendilkumarn
JavaScript is weird* * - sometimes @sendilkumarn
[] + {} @sendilkumarn
[] + {} “[object Object]” @sendilkumarn
{} + [] @sendilkumarn
0 {} + [] @sendilkumarn
[] + {} === {} + [] @sendilkumarn
[] + {} === {} + [] True @sendilkumarn
@sendilkumarn JavaScript Tuning
@sendilkumarn Types
@sendilkumarn Polymorphism
@sendilkumarn Unpredictable Performance
@sendilkumarn Runtime exceptions
@sendilkumarn A B
@sendilkumarn A B [empty x 5] []
@sendilkumarn A B [1, empty x 4] [1, 2, empty
x 3] [1, 2, 3, empty x 2] [1, 2, 3, 4, empty x 1] [1, 2, 3, 4, 5] [1] [1, 2] [1, 2, 3] [1, 2, 3, 4] [1, 2, 3, 4, 5]
@sendilkumarn A B Holey Array Packed Array
@sendilkumarn How WebAssembly address the problems?
@sendilkumarn Speed
@sendilkumarn Near Native perf.
@sendilkumarn ˜30% faster than JS
@sendilkumarn Boundary Crossing
@sendilkumarn Not always faster
@sendilkumarn WebAssembly is secure
@sendilkumarn Linear Memory Model
@sendilkumarn Shared Array Buffer
@sendilkumarn How it works… Why it is faster?
@sendilkumarn JavaScript Execution
@sendilkumarn Load JavaScript
@sendilkumarn a.js AST 1001010010101101010 Execute Profiler Parse Interpret Compile 100101001010
Optimise 1010 GC
@sendilkumarn WebAssembly Execution
@sendilkumarn Load WebAssembly
@sendilkumarn Decode Compile Execute 00 61 73 6D 00 61
73 6D 00 61 73 6D
@sendilkumarn PARSE COMPILE OPTIMISE EXECUTE GC JavaScript execution DECODE COMPILE
EXECUTE WebAssembly execution
@sendilkumarn PARSE COMPILE OPTIMISE EXECUTE GC JavaScript execution DECODE COMPILE
EXECUTE WebAssembly execution I am faster
@sendilkumarn PARSE COMPILE OPTIMISE EXECUTE GC JavaScript execution DECODE COMPILE
EXECUTE WebAssembly execution Optimised already
@sendilkumarn Streaming compilation
@sendilkumarn Typed
@sendilkumarn (module )
@sendilkumarn (module (func $add (param $lhs i32) (param $rhs i32)
(result i32) (get_local $lhs) (get_local $rhs) (i32.add) ) )
@sendilkumarn (module (func $add (param $lhs i32) (param $rhs i32)
(result i32) (get_local $lhs) (get_local $rhs) (i32.add) ) (export “add” (func $add)) )
@sendilkumarn i32 i64 f32 f64 00 61 73 6D 01
00 00 00 WebAssembly Binary JavaScript Javascript Engine
Demo bit.ly/wasm2020-001 @sendilkumarn
Why Rust? @sendilkumarn
@sendilkumarn Blazingly fast @sendilkumarn
@sendilkumarn Memory Safety
@sendilkumarn Productivity
@sendilkumarn Friendly compiler
@sendilkumarn Better tooling support
@sendilkumarn Awesome co!"unity
@sendilkumarn Modern language
@sendilkumarn Crates
@sendilkumarn wasm_bindgen https://github.com/rustwasm/wasm-bindgen
@sendilkumarn i32 i64 f32 f64 00 61 73 6D 01
00 00 00 WebAssembly Binary JavaScript Javascript Engine
@sendilkumarn 00 61 73 6D 01 00 00 00 WebAssembly
Binary JavaScript Javascript Engine Binding JS file JS API WEB API JS SYS WEB SYS
@sendilkumarn wasm_pack https://github.com/rustwasm/wasm-pack
@sendilkumarn PACK PUBLISH TEST BUILD
@sendilkumarn wasm_snip https://github.com/rustwasm/wasm-snip
@sendilkumarn twiggy https://github.com/rustwasm/twiggy
@sendilkumarn Rust demo First demo wasm-game-of-life
@sendilkumarn Future
@sendilkumarn Threads
@sendilkumarn ⚠ Exception Handling
@sendilkumarn ♻ Garbage Collection
@sendilkumarn WebAssembly provides a platform to plug and play best
parts from different languages and use them together.
@sendilkumarn Questions…
@sendilkumarn Thanks… @sendilkumarn dev.to/sendilkumarn sendilkumarn.com/blog