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
JavaScript one of the most popular language
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
JS Fest 2018. Александр Скачков. WebAssembly 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?
JS Fest 2018. Александр Скачков. WebAssembly 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
JS Fest 2018. Александр Скачков. WebAssembly 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
fast to load
Byte code
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
Will WebAssembly replace JavaScript?
Not now 
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
WebAssembly vs JavaScript
HOW ENGINE WORKS
JS
WASM
VS
LOADING
text format binary format
fast to load
BYTE CODE
LOADING
text format
<script>
blocking load
binary format
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
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
$0 10
Stack
S-expression
$0
10
10 * $0
Stack
S-expression
10 * $0
Stack
S-expression
PARSE
text format
ambiguous syntax
lazy parsing
binary format
S - expression
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
JS Fest 2018. Александр Скачков. WebAssembly 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
JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript
CONCURRENT PARSING
no concurrent parsing
only researches
concurrent parsing
fast to load
CONCURRENT PARSING
no concurrent parsing
only researches
concurrent parsing
streaming API
1
3 2 1
5 4 3 2 1
CONCURRENT PARSING
no concurrent parsing
only researches
concurrent parsing
streaming API
COMPILITION + OPTIMIZATION
main thread
optimization after
execution
threads
offline optimization
EXECUTION
slow at start
threads - workers
no native threads
GC
1.2 of native speed
threads – workers
native threads - future
no GC now
EXECUTION
many types
access to DOM
access to Web API
access to JS functions
only 4 primitive types
no access to DOM
no access to Web API
access to JS functions
MODULES
ES modules import/export
function anywhere
wasm modules
strict structure
JS Fest 2018. Александр Скачков. WebAssembly 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
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
• Not only WEB: nodejs native modules with WASM+FFI
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/
JS Fest 2018. Александр Скачков. WebAssembly 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)

PPTX
Oleksandr Skachkov "How to run WebAssembly in your React web application"
Fwdays
 
PPTX
Web Assembly Big Picture
Yousif Shalaby
 
PPTX
Web assembly: a brief overview
Pavlo Iatsiuk
 
PPTX
Blazor
Sandun Perera
 
PPT
Fast Slim Correct: The History and Evolution of JavaScript.
John Dalziel
 
PDF
Isomorphic JavaScript: #DevBeat Master Class
Spike Brehm
 
PDF
Mean Stack - An Overview
Naveen Pete
 
PPTX
WebAssembly overview. KievJS meetup
Alexandr Skachkov
 
PPTX
Evolution of java script libraries
Columbia Developers Guild
 
PDF
Cloud App Develop
Fin Chen
 
PPTX
MEAN Stack
Dotitude
 
PPTX
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Hariharan Ganesan
 
PDF
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Spike Brehm
 
PPTX
Introduction to mean stack
Praveen Gubbala
 
PDF
Building Isomorphic JavaScript Apps - NDC 2015
Eirik Vullum
 
PPTX
Blazor - An Introduction
JamieTaylor112
 
PPTX
Mean stack
RavikantGautam8
 
PDF
React server side rendering performance
Nick Dreckshage
 
PPTX
What is Mean Stack Development ?
Balajihope
 
Oleksandr Skachkov "How to run WebAssembly in your React web application"
Fwdays
 
Web Assembly Big Picture
Yousif Shalaby
 
Web assembly: a brief overview
Pavlo Iatsiuk
 
Fast Slim Correct: The History and Evolution of JavaScript.
John Dalziel
 
Isomorphic JavaScript: #DevBeat Master Class
Spike Brehm
 
Mean Stack - An Overview
Naveen Pete
 
WebAssembly overview. KievJS meetup
Alexandr Skachkov
 
Evolution of java script libraries
Columbia Developers Guild
 
Cloud App Develop
Fin Chen
 
MEAN Stack
Dotitude
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Hariharan Ganesan
 
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Spike Brehm
 
Introduction to mean stack
Praveen Gubbala
 
Building Isomorphic JavaScript Apps - NDC 2015
Eirik Vullum
 
Blazor - An Introduction
JamieTaylor112
 
Mean stack
RavikantGautam8
 
React server side rendering performance
Nick Dreckshage
 
What is Mean Stack Development ?
Balajihope
 

Similar to JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript (20)

PPTX
WebAssembly: In a Nutshell
RangHo Lee
 
PPT
Web assembly overview by Mikhail Sorokovsky
Valeriia Maliarenko
 
PDF
Oleksandr Skachkov - WebAssembly vs JavaScript: What is faster?
OdessaJS Conf
 
PDF
Web assembly brings the web to a new era
Boyan Mihaylov
 
PDF
Boyan Mihaylov - Is web assembly the killer of javascript
Codemotion
 
PDF
Is WebAssembly the killer of JavaScript?
Boyan Mihaylov
 
PPTX
WebAssembly WASM Introduction Presentation
Brad Beiermann
 
PDF
WebAssembly - kolejny buzzword, czy (r)ewolucja?
Brainhub
 
PPTX
Blazor v1.1
Juan Luis Guerrero Minero
 
ODP
An Introduction to WebAssembly
Daniel Budden
 
PPTX
We come in peace hybrid development with web assembly - Maayan Hanin
CodeValue
 
PDF
WebAssembly Overview
Alexandr Skachkov
 
PDF
Web (dis)assembly
Shakacon
 
PDF
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki
 
PDF
WebAssembly - The Journey (BrazilJS 2017 talk)
Elia Maino
 
PPTX
A Brief introduction to Webassembly
Manuel Eusebio de Paz Carmona
 
PDF
WebAssembly - czy dzisiaj mi się to przyda do pracy?
Brainhub
 
PDF
Web Assembly
Valerio Como
 
PDF
Web Assembly (W3C TPAC presentation)
Kenneth Rohde Christiansen
 
PPTX
Web assembly with go
WangChow1
 
WebAssembly: In a Nutshell
RangHo Lee
 
Web assembly overview by Mikhail Sorokovsky
Valeriia Maliarenko
 
Oleksandr Skachkov - WebAssembly vs JavaScript: What is faster?
OdessaJS Conf
 
Web assembly brings the web to a new era
Boyan Mihaylov
 
Boyan Mihaylov - Is web assembly the killer of javascript
Codemotion
 
Is WebAssembly the killer of JavaScript?
Boyan Mihaylov
 
WebAssembly WASM Introduction Presentation
Brad Beiermann
 
WebAssembly - kolejny buzzword, czy (r)ewolucja?
Brainhub
 
An Introduction to WebAssembly
Daniel Budden
 
We come in peace hybrid development with web assembly - Maayan Hanin
CodeValue
 
WebAssembly Overview
Alexandr Skachkov
 
Web (dis)assembly
Shakacon
 
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki
 
WebAssembly - The Journey (BrazilJS 2017 talk)
Elia Maino
 
A Brief introduction to Webassembly
Manuel Eusebio de Paz Carmona
 
WebAssembly - czy dzisiaj mi się to przyda do pracy?
Brainhub
 
Web Assembly
Valerio Como
 
Web Assembly (W3C TPAC presentation)
Kenneth Rohde Christiansen
 
Web assembly with go
WangChow1
 
Ad

More from JSFestUA (20)

PDF
JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in production
JSFestUA
 
PDF
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JSFestUA
 
PDF
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JSFestUA
 
PDF
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JSFestUA
 
PDF
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...
JSFestUA
 
PDF
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Александр Товмач. JAMstack
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developers
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JSFestUA
 
PDF
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratch
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотят
JSFestUA
 
PDF
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JSFestUA
 
PDF
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проекті
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядро
JSFestUA
 
PPTX
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JSFestUA
 
JS Fest 2019/Autumn. Роман Савіцький. Webcomponents & lit-element in production
JSFestUA
 
JS Fest 2019/Autumn. Erick Wendel. 10 secrets to improve Javascript Performance
JSFestUA
 
JS Fest 2019/Autumn. Alexandre Gomes. Embrace the "react fatigue"
JSFestUA
 
JS Fest 2019/Autumn. Anton Cherednikov. Choreographic or orchestral architect...
JSFestUA
 
JS Fest 2019/Autumn. Adam Leos. So why do you need to know Algorithms and Dat...
JSFestUA
 
JS Fest 2019/Autumn. Marko Letic. Saving the world with JavaScript: A Data Vi...
JSFestUA
 
JS Fest 2019/Autumn. Александр Товмач. JAMstack
JSFestUA
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JSFestUA
 
JS Fest 2019/Autumn. Дмитрий Жарков. Blockchainize your SPA or Integrate Java...
JSFestUA
 
JS Fest 2019/Autumn. Maciej Treder. Angular Schematics - Develop for developers
JSFestUA
 
JS Fest 2019/Autumn. Kyle Boss. A Tinder Love Story: Create a Wordpress Blog ...
JSFestUA
 
JS Fest 2019/Autumn. Андрей Старовойт. Зачем нужен тип "true" в TypeScript?
JSFestUA
 
JS Fest 2019/Autumn. Eyal Eizenberg. Tipping the Scale
JSFestUA
 
JS Fest 2019/Autumn. Sota Ohara. Сreate own server less CMS from scratch
JSFestUA
 
JS Fest 2019/Autumn. Джордж Евтушенко. Как стать программистом, которого хотят
JSFestUA
 
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JSFestUA
 
JS Fest 2019/Autumn. Daniel Ostrovsky. Falling in love with decorators ES6/Ty...
JSFestUA
 
JS Fest 2019/Autumn. Андрей Андрийко. Гексагональна архітектура в Nodejs проекті
JSFestUA
 
JS Fest 2019/Autumn. Борис Могила. Svelte. Почему нам не нужно run-time ядро
JSFestUA
 
JS Fest 2019/Autumn. Виталий Кухар. Сравнение кластеризации HTTP, TCP и UDP н...
JSFestUA
 
Ad

Recently uploaded (20)

PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Introduction presentation of the patentbutler tool
MIPLM
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Controller Request and Response in Odoo18
Celine George
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Horarios de distribución de agua en julio
pegazohn1978
 

JS Fest 2018. Александр Скачков. WebAssembly vs JavaScript

Editor's Notes

  • #5: Stackoverflow.com
  • #6: Stackoverflow.com
  • #7: Stackoverflow.com
  • #11: