SlideShare a Scribd company logo
From back-end to front-end
Киев 2018
WebAssembly vs JavaScript
Скачков Александр
@alSkachkov
ABOUT ME
• Itera’s FrontEnd Tech Lead
• WebKit contributor:
• Arrow function
• Async iterator & generators
• Promise.finally
• Twitter: @alSkachkov
WebAssembly vs JavaScript Киев 2018
• What was before
• WebAssembly vs JavaScript
• WebAssembly – in real life
• WebAssembly – how start
• WebAssembly – roadmap
JavaScript one of the most popular language
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
THE STRENGTH IS A WEAKNESS
• Easy to learn
• King of the web
• Dynamic typing
=
• NOT PREDICTIBLE PERFORMANCE!
TRIES TO SOLVE
asm.js
SMART PEOPLE SAYS
Always bet on JS & WASM
Always bet on JS
WASM?
WebAssemlby vs JavaScript
• Announced in 17 June 2015
• Supported by major Browsers
• Developed by WebAssembly Working
Group (W3C)
• Draft specific published 15 Feb 2018
WebAssembly – New Hope
What is WebAssembly (aka WASM)?
WebAssembly is build target
WebAssemlby vs JavaScript
safe, portable, low-level code format designed for efficient execution
and compact representation
https://webassembly.github.io/spec/intro
C - Source code
RUST - Source code
S - Expression
WAT?
fast to load
Byte code
WebAssemlby vs JavaScript
WebAssembly vs JavaScript
HOW ENGINE WORKS
JS
WebAssembly
VS
LOADING
LOADING
text format binary format
fast to load
BYTE CODE
LOADING
text format
<script>
blocking load
binary format
WebAssemlby vs JavaScript
LOADING
text format
<script>
blocking load
binary format
LOADING
text format
<script>
blocking load
binary format
fetch
LOADING
text format
<script>
blocking load
binary format
fetch
non blocking load
PARSING
text format
ambiguous syntax
binary format
const foo = x
const foo = x;
const foo = x >
const foo = x =>
const foo = x ?
PARSE
text format
ambiguous syntax
binary format
S – expression
S-expression
S-expression
S-expression
S-expression
S-expression
Stack
S-expression
Stack
S-expression
$0
Stack
S-expression
$0
Stack
S-expression
$0
10
Stack
S-expression
$0
10
Stack
S-expression
$0
10
Stack
S-expression
10 * $0
Stack
S-expression
10 * $0
Stack
S-expression
10 * $0
Stack
S-expression
PARSE
text format
ambiguous syntax
binary format
S - expression
PARSE
text format
ambiguous syntax
lazy parsing
binary format
S - expression
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
WebAssemlby vs JavaScript
PARSING
text format
ambiguous syntax
lazy parsing
binary format
S-expression
no lazy parsing
CONCURRENT PARSING
no concurrent parsing
only researches
Proposed concurrent parser for JS
WebAssemlby vs JavaScript
CONCURRENT PARSING
no concurrent parsing
only researches
CONCURRENT PARSING
no concurrent parsing
only researches
concurrent parsing
fast to load
CONCURRENT PARSING
no concurrent parsing
only researches
concurrent parsing
streaming API
5 4 3 2 1
CONCURRENT PARSING
no concurrent parsing
only researches
concurrent parsing
streaming API
COMPILATION + OPTIMIZATION
main thread
optimization after
execution
threads
offline optimization
EXECUTION
slow at start
threads - workers
no native threads
GC
close to native speed
threads – workers
native threads - future
no GC now
EXECUTION
many types
access to JS functions
access to DOM
access to Web API
only 4 primitive types
access to JS functions
no access to DOM
no access to Web API
MODULES
ES modules import/export
function anywhere
wasm modules
strict structure
WebAssemlby vs JavaScript
MODULES
ES modules import/export
function anywhere
any function from scope
wasm modules
strict structure
explicit import
INTERACTION WITH JAVASCRIPT
We can use JS function in WASM and WASM function in JS
Will WebAssembly replace JavaScript?
Will WebAssembly replace JavaScript?
Not now J
but WebAssembly will transform web
WASM WILL BRING TO WEB
• High performance
• New languages
• Variety of existed libraries
WHAT'S NEW IN THE WEB
• New types of applications will appear in Web
• graphical, video and audio editors
• games that fully consume CPU power
• other performance intensive application in browser
• New languages will be run in Browser and NodeJS
CAN WE USE WEBASSEMBLY?
Yes we can
BUILD TARGET FOR
• C/C++
• Rust
• C# - Mono and CoreRT
• Go
• BrainFuck
• Even more: https://github.com/appcypher/awesome-wasm-langs
VM
• Blazor: NET code in the browser via the Mono runtime, which itself is
compiled to WebAssembly and asm.js (Steve Sanderson)
• TeaVM: transpiler of Java bytecode, to emit JavaScript and WebAssembly
(Java, Kotlin, Scala) (Alexey Andreev)
• Ocamlrun: OCaml bytecode interpreter for WebAssembly (Sebastian
Markbåge)
USAGE SCENARIOS IN WEB
• Write faster version of the specific application
• Using existing C libraries in browser
• Reuse algorithm from service side
• Distribute whole application as wasm
Ethereum Figma design
Unity Google Earth
Web Audio Modules
HOW TO START
SLOW START
https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm
•CMake
•GCC or Visual Studio 2015
•Emscripten
•Python 2.7.x
QUICK START
WebAssembly Studio
https://webassembly.studio/
WebAssemlby vs JavaScript
ROADMAP
• GC – garbage collector
• Threads
• Exception handling
• Tools
• More proposals are coming : Debug/Source maps, BigInt, SIMD and etc
EXAMPLES
• Video editor: https://d2jta7o2zej4pf.cloudfront.net/
• Game: http://webassembly.org/demo/Tanks/
• Garden for Mozilla: https://s3.amazonaws.com/mozilla-
games/ZenGarden/EpicZenGarden.html (Unreal Engine 4)
• WebSight: https://websightjs.com/
• AutoCAD: https://web.autocad.com/
SUMMARY
• WebAssembly is an emerging technology
• Very promising and supported by all main browsers
• Shortage of tools, libs, resources
• Most WebAssembly features are part of the future specs
RESOURCES
• Articles: https://hacks.mozilla.org/category/webassembly/
• Site: http://webassembly.org/
• Github: https://github.com/WebAssembly/
• Twitter: @WasmWeekly - WebAssemblyWeekly
THANKS!
QUESTIONS?

More Related Content

What's hot (20)

PDF
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki
 
PPTX
Whats new in .net core 3
Pratik Khasnabis
 
PDF
First Step towards WebAssembly with Rust
Knoldus Inc.
 
PPTX
What's New in ASP.NET Core 2.0
Jon Galloway
 
PPTX
Real-time apps using Xamarin + SignalR
Miguel Angel Teheran Garcia
 
PPTX
Migrating .NET Application to .NET Core
Baris Ceviz
 
PPTX
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
David Voyles
 
PDF
What's New in ASP.NET Core 3
Andrea Dottor
 
PPTX
Data Management and Streaming Strategies in Drakensang Online
Andre Weissflog
 
PDF
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Igalia
 
PDF
Sep Nasiri "Upwork PHP Architecture"
Fwdays
 
PDF
Multiplatform C++ on the Web with Emscripten
Chad Austin
 
PDF
Minko - Build WebGL applications with C++ and asm.js
Minko3D
 
PDF
Fixing Gaps. Strengthening the Chromium platform for content blocking
Igalia
 
PDF
Salt and pepper — native code in the browser Browser using Google native Client
Mayflower GmbH
 
PDF
Isomorphic JavaScript with Nashorn
Maxime Najim
 
PPTX
Open API (aka Swagger) - DDD by Night May 2020
Pratik Khasnabis
 
PPTX
Open source and .net
Hrvoje Hudoletnjak
 
PDF
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
Karel Zikmund
 
PDF
Sonata Block Bundle - sfPot March 2014
th0masr
 
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki
 
Whats new in .net core 3
Pratik Khasnabis
 
First Step towards WebAssembly with Rust
Knoldus Inc.
 
What's New in ASP.NET Core 2.0
Jon Galloway
 
Real-time apps using Xamarin + SignalR
Miguel Angel Teheran Garcia
 
Migrating .NET Application to .NET Core
Baris Ceviz
 
Getting started with Emscripten – Transpiling C / C++ to JavaScript / HTML5
David Voyles
 
What's New in ASP.NET Core 3
Andrea Dottor
 
Data Management and Streaming Strategies in Drakensang Online
Andre Weissflog
 
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Igalia
 
Sep Nasiri "Upwork PHP Architecture"
Fwdays
 
Multiplatform C++ on the Web with Emscripten
Chad Austin
 
Minko - Build WebGL applications with C++ and asm.js
Minko3D
 
Fixing Gaps. Strengthening the Chromium platform for content blocking
Igalia
 
Salt and pepper — native code in the browser Browser using Google native Client
Mayflower GmbH
 
Isomorphic JavaScript with Nashorn
Maxime Najim
 
Open API (aka Swagger) - DDD by Night May 2020
Pratik Khasnabis
 
Open source and .net
Hrvoje Hudoletnjak
 
.NET Core Summer event 2019 in Vienna, AT - .NET 5 - Future of .NET on Mobile...
Karel Zikmund
 
Sonata Block Bundle - sfPot March 2014
th0masr
 

Similar to WebAssemlby vs JavaScript (20)

PPTX
Oleksandr Skachkov "How to run WebAssembly in your React web application"
Fwdays
 
PDF
Oleksandr Skachkov - WebAssembly vs JavaScript: What is faster?
OdessaJS Conf
 
PDF
WebAssembly vs JavaScript: What is faster?
Alexandr Skachkov
 
PPTX
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
Fwdays
 
PDF
How to run WebAssembly in your React Web Application
Alexandr Skachkov
 
PPTX
WebAssembly overview. KievJS meetup
Alexandr Skachkov
 
PDF
(2018) Webpack Encore - Asset Management for the rest of us
Stefan Adolf
 
PPTX
Web Assembly Big Picture
Yousif Shalaby
 
PDF
Practical WebAssembly with Apex, wasmRS, and nanobus
Jarrod Overson
 
PPTX
What is Mean Stack Development ?
Balajihope
 
PDF
WebAssembly Overview
Alexandr Skachkov
 
PDF
The shift to the edge
Jakub Wadolowski
 
PPTX
Blazor.pptx
ssuserb1d1a2
 
PDF
The shift to the edge
Jakub Wadolowski
 
PPTX
DevDay 2018 - Blazor
Denis Voituron
 
PDF
Everything-as-code. A polyglot adventure. #DevoxxPL
Mario-Leander Reimer
 
PDF
Everything-as-code - A polyglot adventure
QAware GmbH
 
PDF
Intro to Node.js
Jamal Sinclair O'Garro
 
PPTX
Kiss.ts - The Keep It Simple Software Stack for 2017++
Ethan Ram
 
PDF
Node PDX: Intro to Sails.js
Mike McNeil
 
Oleksandr Skachkov "How to run WebAssembly in your React web application"
Fwdays
 
Oleksandr Skachkov - WebAssembly vs JavaScript: What is faster?
OdessaJS Conf
 
WebAssembly vs JavaScript: What is faster?
Alexandr Skachkov
 
Oleksandr Skachkov "Running С# in your Web Browser with WebAssembly"
Fwdays
 
How to run WebAssembly in your React Web Application
Alexandr Skachkov
 
WebAssembly overview. KievJS meetup
Alexandr Skachkov
 
(2018) Webpack Encore - Asset Management for the rest of us
Stefan Adolf
 
Web Assembly Big Picture
Yousif Shalaby
 
Practical WebAssembly with Apex, wasmRS, and nanobus
Jarrod Overson
 
What is Mean Stack Development ?
Balajihope
 
WebAssembly Overview
Alexandr Skachkov
 
The shift to the edge
Jakub Wadolowski
 
Blazor.pptx
ssuserb1d1a2
 
The shift to the edge
Jakub Wadolowski
 
DevDay 2018 - Blazor
Denis Voituron
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Mario-Leander Reimer
 
Everything-as-code - A polyglot adventure
QAware GmbH
 
Intro to Node.js
Jamal Sinclair O'Garro
 
Kiss.ts - The Keep It Simple Software Stack for 2017++
Ethan Ram
 
Node PDX: Intro to Sails.js
Mike McNeil
 
Ad

Recently uploaded (20)

PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Ad

WebAssemlby vs JavaScript