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
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
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
Wvlet: A New Flow-Style Query Language For Functional Data Modeling and Interactive Data Analysis - Trino Summit 2024
xerial
1
110
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
370
生成AIのガバナンスの全体像と現実解
fnifni
1
180
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
20241220_S3 tablesの使い方を検証してみた
handy
3
360
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
520
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
Featured
See All Featured
A Tale of Four Properties
chriscoyier
157
23k
Designing Experiences People Love
moore
138
23k
Why Our Code Smells
bkeepers
PRO
335
57k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Building Your Own Lightsaber
phodgson
103
6.1k
GitHub's CSS Performance
jonrohan
1030
460k
How GitHub (no longer) Works
holman
311
140k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
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…