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
State of WebAssembly
Search
Sendil Kumar N
February 19, 2020
Technology
0
49
State of WebAssembly
Sendil Kumar N
February 19, 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
CDCL による厳密解法を採用した MILP ソルバー
imai448
3
170
Flutterによる 効率的なAndroid・iOS・Webアプリケーション開発の事例
recruitengineers
PRO
0
120
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
110
Lexical Analysis
shigashiyama
1
150
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
3
630
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
130
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
760
The Rise of LLMOps
asei
8
1.7k
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
180
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
心が動くエンジニアリング ── 私が夢中になる理由
16bitidol
0
100
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
440
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Being A Developer After 40
akosma
87
590k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Typedesign – Prime Four
hannesfritz
40
2.4k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Visualization
eitanlees
145
15k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
@sendilkumarn Hoi Nederland !!!
@sendilkumarn Languages are built for a purpose. Choose & Use
them wisely…
The state of WebAssembly Sendil Kumar N
@sendilkumarn Sendil Kumar
@sendilkumarn Hacking on WebAssembly
JavaScript is weird @sendilkumarn
[1, 2] + [3, 4] @sendilkumarn
1, 23, 4 @sendilkumarn [1, 2] + [3, 4]
1, 23, 4 @sendilkumarn [1, 2].toString() + [3, 4].toString() “1,2”
+ “3, 4”
JavaScript is weird* * - sometimes @sendilkumarn
@sendilkumarn JavaScript Execution
@sendilkumarn Load JavaScript
@sendilkumarn a.js AST 1001010010101101010 Execute Profiler Parse Interpret Compile 100101001010
Optimise 1010 GC
@sendilkumarn JavaScript Tuning
@sendilkumarn Css Tuning
JavaScript is awesome @sendilkumarn ~80% ~90% https://2019.stateofjs.com/opinions/
@sendilkumarn JavaScript is easy https://octoverse.github.com/ 6 years in row
@sendilkumarn https://2019.stateofjs.com/opinions/ ~59% ~40% JavaScript is evolving
So what is the problem? @sendilkumarn
@sendilkumarn Types Polymorphism Unpredictable Performance Runtime exceptions
@sendilkumarn Types 66% users interested to use TypeScript https://2019.stateofjs.com/javascript-flavors/
@sendilkumarn Predicatble Performance Types Unpredictable Performance Typed
WebAssembly @sendilkumarn
Yet Another Frontend framework?
@sendilkumarn 00 61 73 6D 01 00 00 00 Native
Code Binary JavaScript Javascript Engine Runtime
@sendilkumarn 00 61 73 6D 01 00 00 00 Native
Code Binary JavaScript Javascript Engine
WebAssembly is not a language @sendilkumarn
@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 What WebAssembly provides?
@sendilkumarn Speed
@sendilkumarn Near Native perf. ~30% faster than JS
@sendilkumarn secure
@sendilkumarn Linear Memory Model
@sendilkumarn Shared Array Buffer
@sendilkumarn Typed
@sendilkumarn i32 i64 f32 f64 00 61 73 6D 01
00 00 00 WebAssembly Binary JavaScript Javascript Engine Binding JS file
@sendilkumarn Boundary Crossing
@sendilkumarn Not always faster
@sendilkumarn How WASM works?
@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
What languages can do wasm? @sendilkumarn
C/C++ @sendilkumarn
@sendilkumarn ./emcc -O3 helloworld.c
Why C/C++? @sendilkumarn Tons of options All batteries included Verbose
Rust @sendilkumarn
@sendilkumarn $ wasm-pack build $ cargo install wasm-pack
Why Rust? @sendilkumarn Inbuilt into the compiler All batteries included
Best tooling support Sometimes bigger binaries
AssemblyScript @sendilkumarn
@sendilkumarn $ asc helloworld.ts -b helloworld.wasm -O3 $ npm i
--save-dev assemblyscript
Why AssemblyScript? @sendilkumarn Closer to JavaScript community Good tooling support
/ options
Go @sendilkumarn
@sendilkumarn $ GOOS=js GOARCH=wasm go build -o out/main.wasm go/main.go
Why Go? @sendilkumarn Easy & Concise TinyGo is awesome Reflections
& Proxies everywhere
@sendilkumarn Future
@sendilkumarn Interface types
@sendilkumarn Single Instruction Multiple Data
@sendilkumarn ♻ Garbage Collection
@sendilkumarn WASI WebAssembly System Interface
JavaScript with WebAssembly together makes web even more awesome &
faster @sendilkumarn
@sendilkumarn Thanks… @sendilkumarn dev.to/sendilkumarn sendilkumarn.com/blog Questions…