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
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
The Rise of LLMOps
asei
7
1.4k
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
470
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
いざ、BSC討伐の旅
nikinusu
2
780
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
380
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
410
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.8k
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
327
21k
Six Lessons from altMBA
skipperchong
27
3.5k
Typedesign – Prime Four
hannesfritz
40
2.4k
The Invisible Side of Design
smashingmag
298
50k
Designing for Performance
lara
604
68k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Building an army of robots
kneath
302
43k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Site-Speed That Sticks
csswizardry
0
23
Navigating Team Friction
lara
183
14k
A Philosophy of Restraint
colly
203
16k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
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