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
110
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
72
Building Reactive Microservices with Kotlin & running on Kubernetes
sendilkumarn
0
160
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
220
Other Decks in Technology
See All in Technology
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
550
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
150
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
31k
podman_update_2024-12
orimanabu
1
260
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
700
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Being A Developer After 40
akosma
87
590k
Writing Fast Ruby
sferik
628
61k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
4 Signs Your Business is Dying
shpigford
181
21k
Mobile First: as difficult as doing things right
swwweet
222
9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
The Pragmatic Product Professional
lauravandoore
32
6.3k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
What's in a price? How to price your products and services
michaelherold
243
12k
Scaling GitHub
holman
458
140k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
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