SlideShare a Scribd company logo
1 of 133
WebAssemblyneither Web nor Assembly, but Revolutionary
Jay Phelps | @_jayphelps
InfoQ.com: News & Community Site
• Over 1,000,000 software developers, architects and CTOs read the site world-
wide every month
• 250,000 senior developers subscribe to our weekly newsletter
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• 2 dedicated podcast channels: The InfoQ Podcast, with a focus on
Architecture and The Engineering Culture Podcast, with a focus on building
• 96 deep dives on innovative topics packed as downloadable emags and
minibooks
• Over 40 new content items per week
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
webassembly-intro
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Presented at QCon San Francisco
www.qconsf.com
Jay Phelps | @_jayphelps
The WebAssembly revolution has begun
Chief Software Architect |
previously
Jay Phelps
@_jayphelps
Support, Dev Rel, Staff Augmentation, Mentorship, and more
www.thisdot.co
Jay Phelps | @_jayphelps
So...what is WebAssembly? aka Wasm
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Web
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Web
Jay Phelps | @_jayphelps
Fast to load and execute
Jay Phelps | @_jayphelps
Streaming compilation
compiled to machine code faster than it downloads
(func $0 (type 0)
i32.const 0
i32.load
)
(func $1 (type 0)
i32.const 0
i32.load
)
(func $2 (type 0)
i32.const 0
i32.load
)
(func $3 (type 0)
i32.const 0
i32.load
)
.wasm
(func $0 (type 0)
i32.const 0
i32.load
)
(func $1 (type 0)
i32.const 0
i32.load
)
(func $2 (type 0)
i32.const 0
i32.load
)
(func $3 (type 0)
i32.const 0
i32.load
)
.wasm machine code
(func $0 (type 0)
i32.const 0
i32.load
)
(func $1 (type 0)
i32.const 0
i32.load
)
(func $2 (type 0)
i32.const 0
i32.load
)
(func $3 (type 0)
i32.const 0
i32.load
)
.wasm machine code
wasm-function[0]:
sub rsp, 8
mov eax, dword ptr [r15]
nop
add rsp, 8
wasm-function[1]:
sub rsp, 8
mov eax, dword ptr [r15]
nop
add rsp, 8
wasm-function[2]:
sub rsp, 8
mov eax, dword ptr [r15]
nop
add rsp, 8
wasm-function[3]:
sub rsp, 8
mov eax, dword ptr [r15]
nop
add rsp, 8
.wasm machine code
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Websafe
Jay Phelps | @_jayphelps
Sandboxed and designed with security in mind
Control-flow integrity checks, stack protection,
dynamic dispatch table separate from linear memory
Jay Phelps | @_jayphelps
However, does not prevent all classes of exploits
Code reuse, side channel, race conditions, etc
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Weblow-level bytecode
Jay Phelps | @_jayphelps
WebAssembly is a portable, binary
instruction set for a virtual machine
Jay Phelps | @_jayphelps
0x6a01101010
(the i32.add instruction)
Jay Phelps | @_jayphelps
Intended (mostly) as a compilation target
int factorial(int n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
int factorial(int n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
00 61 73 6D 01 00 00 00 01
86 80 80 80 00 01 60 01 7F
01 7F 03 82 80 80 80 00 01
00 06 81 80 80 80 00 00 0A
9D 80 80 80 00 01 97 80 80
80 00 00 20 00 41 00 46 04
40 41 01 0F 0B 20 00 41 01
6B 10 00 20 00 6C 0B
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Web
Jay Phelps | @_jayphelps
How did we get here?
Jay Phelps | @_jayphelps
Primary goals:
languages other than JavaScript and
great—ideally improved—performance
Jay Phelps | @_jayphelps
Java Applets
Never truly integrated into browsers
Jay Phelps | @_jayphelps
Why not integrate the JVM or CLR?
misaligned goals, mostly related to validation/compiling
Jay Phelps | @_jayphelps
Portable Native Client (PNaCl)
lead by Google
Jay Phelps | @_jayphelps
asm.js
lead by Mozilla
size_t strlen(char *ptr) {
char *curr = ptr;
while (*curr != 0) {
curr++;
}
return (curr - ptr);
}
"use asm"
function strlen(ptr) {
ptr = ptr|0;
var curr = 0;
curr = ptr;
while (MEM8[curr]|0 != 0) {
curr = (curr + 1)|0;
}
return (curr - ptr)|0;
}
asm.jsC
!
Jay Phelps | @_jayphelps
WebAssembly !
Jay Phelps | @_jayphelps
WebAssembly is an unprecedented collaboration
Jay Phelps | @_jayphelps
The first open and standardized bytecode
Jay Phelps | @_jayphelps
Is it going to kill JavaScript?
Jay Phelps | @_jayphelps
Is it going to kill JavaScript?
Jay Phelps | @_jayphelps
Nope!
Jay Phelps | @_jayphelps
Will we compile JavaScript to WebAssembly?
Jay Phelps | @_jayphelps
JavaScript is an extremely dynamic language
Jay Phelps | @_jayphelps
Fully spec compliant JavaScript compiled
to WebAssembly would be slower
Jay Phelps | @_jayphelps
…but a strict subset of JavaScript could be fast!
Jay Phelps | @_jayphelps
WebAssembly v1 MVP is best suited for
languages like C/C++ and Rust
Jay Phelps | @_jayphelps
Ideal for relatively low-level, system languages
Very little dynamic features at run-time, no GC
Jay Phelps | @_jayphelps
Some modern features of C++
don’t perform ideal
Jay Phelps | @_jayphelps
Exceptions are the most common example
Jay Phelps | @_jayphelps
But other languages are already
supported, and more planned
Things like Go, .NET, Java, OCaml, and even new ones
Jay Phelps | @_jayphelps
WebAssembly will impact language
design and implementation
Jay Phelps | @_jayphelps
The Web requires unique considerations
Jay Phelps | @_jayphelps
Rust team has specifically called out
WebAssembly as a priority
Jay Phelps | @_jayphelps
File sizes
as well as lazy-loading/code splitting, caching, etc
Jay Phelps | @_jayphelps
Shared libraries
Traditional platforms like iOS/Android/macOS/
Windows have more robust stdlibs and UI toolkits
Jay Phelps | @_jayphelps
Offline
Caching story much more complex than desktop
Jay Phelps | @_jayphelps
Interop with JavaScript
Languages which better interop with JS have major advantage
Jay Phelps | @_jayphelps
Promising: Dart, Elm, Reason
Languages designed for the Web
Jay Phelps | @_jayphelps
a TypeScript-like language?
AssemblyScript is an early example
Jay Phelps | @_jayphelps
export function factorial(n: i32): i32 {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
AssemblyScript
Jay Phelps | @_jayphelps
When should I target WebAssembly right now?
Jay Phelps | @_jayphelps
Heavily CPU-bound number computations
Jay Phelps | @_jayphelps
Games
both Unity and Unreal Engine offer support
Jay Phelps | @_jayphelps
Using existing portable code
e.g. video/audio decoders and other processing
Jay Phelps | @_jayphelps
bcrypt
OpenCV
mcl
bls
web-dsp
hunspell
XSalsa20
GDAL
SPHINCS
NTRUxxHash
RLWE
McEliece
Zopfli
SIDH
ttf2woff2
Jay Phelps | @_jayphelps
Zoom for Web client
Video conferencing powered by WebAssembly,
video/audio decoding off the main thread
react-native-dom
(not react-native-web)
Jay Phelps | @_jayphelps
Web UI developers are probably already using
WebAssembly without knowing it!
Jay Phelps | @_jayphelps
source-map npm package
10.9x faster!
used by Firefox, Babel, create-react-app, LESS, etc
Jay Phelps | @_jayphelps
Other use cases are just around the corner
Jay Phelps | @_jayphelps
What was that binary stuff?
int factorial(int n) {
if (n == 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
00 61 73 6D 01 00 00 00 01
86 80 80 80 00 01 60 01 7F
01 7F 03 82 80 80 80 00 01
00 06 81 80 80 80 00 00 0A
9D 80 80 80 00 01 97 80 80
80 00 00 20 00 41 00 46 04
40 41 01 0F 0B 20 00 41 01
6B 10 00 20 00 6C 0B
00 61 73 6D 01 00 00 00 01
86 80 80 80 00 01 60 01 7F
01 7F 03 82 80 80 80 00 01
00 06 81 80 80 80 00 00 0A
9D 80 80 80 00 01 97 80 80
80 00 00 20 00 41 00 46 04
40 41 01 0F 0B 20 00 41 01
6B 10 00 20 00 6C 0B
00 61 73 6D 01 00 00 00 01
86 80 80 80 00 01 60 01 7F
01 7F 03 82 80 80 80 00 01
00 06 81 80 80 80 00 00 0A
9D 80 80 80 00 01 97 80 80
80 00 00 20 00 41 00 46 04
40 41 01 0F 0B 20 00 41 01
6B 10 00 20 00 6C 0B
00 61 73 6D 01 00 00 00 01
86 80 80 80 00 01 60 01 7F
01 7F 03 82 80 80 80 00 01
00 06 81 80 80 80 00 00 0A
9D 80 80 80 00 01 97 80 80
80 00 00 20 00 41 00 46 04
40 41 01 0F 0B 20 00 41 01
6B 10 00 20 00 6C 0B
03 82 80 80 80 0
81 80 80 80 00 0
80 80 00 01 97 8
00 20 00 41 00 4
03 82 80 80 80 0
81 80 80 80 00 0
80 80 00 01 97 8
00 20 00 41 00 4
03 82 80 80 80 0
81 80 80 80 00 0
80 80 00 01 97 8
00 20 00 41 00 4
Jay Phelps | @_jayphelps
Binary can be a little intimidating
Jay Phelps | @_jayphelps
Protip: don't worry about it
(unless of course, you want to)
Jay Phelps | @_jayphelps
Tooling will eventually make it a non-issue
Jay Phelps | @_jayphelps
Textual representation to the rescue!
Jay Phelps | @_jayphelps
(func $factorial (param $n i32) (result i32)
get_local $n
i32.const 0
i32.eq
if $if0
i32.const 1
return
end $if0
get_local $n
i32.const 1
i32.sub
call $factorial
get_local $n
i32.mul
)
Jay Phelps | @_jayphelps
(func $factorial (param $n i32) (result i32)
get_local $n
i32.const 0
i32.eq
if $if0
i32.const 1
return
end $if0
get_local $n
i32.const 1
i32.sub
call $factorial
get_local $n
i32.mul
)
Jay Phelps | @_jayphelps
Let's learn the fundamentals
Jay Phelps | @_jayphelps
WebAssembly is a stack machine
Jay Phelps | @_jayphelps
...what's a stack machine?
Jay Phelps | @_jayphelps
a data structure with two operations:
push and pop
Stack
Jay Phelps | @_jayphelps
stack machine: instructions on a stack
Jay Phelps | @_jayphelps
Why a stack machine?
instead of AST, SSA, or register machine
Jay Phelps | @_jayphelps
Smaller binary encoding, easier and faster
single pass verification and VM implementation
1 + 2
i32.add 0x6a
opcode mnemonics
01101010
i32.const 1
i32.const 2
i32.add
stack
i32.const 1
i32.const 2
i32.add
i32.const 1
i32.const 2
i32.add
i32.const 1
stack
1
i32.const 1
i32.const 2
i32.add
i32.const 1
stack
1
i32.const 1
i32.const 2
i32.add
i32.const 2
stack
2
1
i32.const 1
i32.const 2
i32.add
i32.const 2
stack
2
1
i32.const 1
i32.const 2
i32.addi32.add
stack
1
2
i32.const 1
i32.const 2
i32.addi32.add
stack
1
2
i32.const 1
i32.const 2
i32.addi32.add
stack
3
i32.const 1
i32.const 2
i32.addi32.add
stack
3
i32.const 1
i32.const 2
i32.add
Jay Phelps | @_jayphelps
i32.const 1
i32.const 2
i32.add
call $log
Jay Phelps | @_jayphelps
Jay Phelps | @_jayphelps
What's missing?
Jay Phelps | @_jayphelps
Direct access to Host APIs (e.g. the DOM)
no direct access to sys calls, you have to call into JavaScript
Jay Phelps | @_jayphelps
Garbage collection
necessary for better interop with JavaScript
and WebIDL (e.g. the DOM)
Jay Phelps | @_jayphelps
Multi-threading
SharedArrayBuffer re-enabled in Chrome 68
Jay Phelps | @_jayphelps
Single Instruction Multiple Data (SIMD)
Hardware parallelization of vector computations
Jay Phelps | @_jayphelps
Zero-cost exceptions
someday maybe even Algebraic Effects (!!!)
Jay Phelps | @_jayphelps
There's more, but advancing quickly!
Jay Phelps | @_jayphelps
How do I get started?
Jay Phelps | @_jayphelps
webassembly.org
Jay Phelps | @_jayphelps
https://github.com/mbasso/awesome-wasm
Supported in all modern browsers
Jay Phelps | @_jayphelps
The revolution is just beginning
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Web
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Web?
Jay Phelps | @_jayphelps
The first open and standardized bytecode
Jay Phelps | @_jayphelps
WebAssembly is not just for the Web!
ewasm
Etherium-flavored WebAssembly VM for
running distributed smart contracts
rianhunter/wasmjit
VM and Linux kernel module for
running WebAssembly in “ring 0”
nebulet
microkernel that runs WebAssembly exclusively
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Web
Jay Phelps | @_jayphelps
Efficient, safe, low-level bytecode for the Web
Jay Phelps | @_jayphelps
Thanks!
@_jayphelps
Watch the video with slide
synchronization on InfoQ.com!
https://www.infoq.com/presentations/
webassembly-intro

More Related Content

What's hot

Scala and Hadoop @ eBay
Scala and Hadoop @ eBayScala and Hadoop @ eBay
Scala and Hadoop @ eBayebaynyc
 
The WebAssembly Revolution Has Begun
The WebAssembly Revolution Has BegunThe WebAssembly Revolution Has Begun
The WebAssembly Revolution Has BegunJay Phelps
 
Dapper Tool - A Bundle to Make your ECL Neater
Dapper Tool - A Bundle to Make your ECL NeaterDapper Tool - A Bundle to Make your ECL Neater
Dapper Tool - A Bundle to Make your ECL NeaterHPCC Systems
 
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Puppet
 
CliqueSquare processing
CliqueSquare processingCliqueSquare processing
CliqueSquare processingINRIA-OAK
 
Python - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave ParkPython - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave Parkpointstechgeeks
 
Perl Teach-In (part 1)
Perl Teach-In (part 1)Perl Teach-In (part 1)
Perl Teach-In (part 1)Dave Cross
 
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic InterpolationBASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic InterpolationWorkhorse Computing
 
OOP is more than Cars and Dogs
OOP is more than Cars and Dogs OOP is more than Cars and Dogs
OOP is more than Cars and Dogs Chris Tankersley
 
Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern PerlDave Cross
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.Workhorse Computing
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl TechniquesDave Cross
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Prof. Wim Van Criekinge
 

What's hot (20)

Jquery2012 defs
Jquery2012 defsJquery2012 defs
Jquery2012 defs
 
Scala and Hadoop @ eBay
Scala and Hadoop @ eBayScala and Hadoop @ eBay
Scala and Hadoop @ eBay
 
The WebAssembly Revolution Has Begun
The WebAssembly Revolution Has BegunThe WebAssembly Revolution Has Begun
The WebAssembly Revolution Has Begun
 
Dapper Tool - A Bundle to Make your ECL Neater
Dapper Tool - A Bundle to Make your ECL NeaterDapper Tool - A Bundle to Make your ECL Neater
Dapper Tool - A Bundle to Make your ECL Neater
 
Command Liner with Scala
Command Liner with ScalaCommand Liner with Scala
Command Liner with Scala
 
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
 
Power of Puppet 4
Power of Puppet 4Power of Puppet 4
Power of Puppet 4
 
CliqueSquare processing
CliqueSquare processingCliqueSquare processing
CliqueSquare processing
 
P4 2018 io_functions
P4 2018 io_functionsP4 2018 io_functions
P4 2018 io_functions
 
Python - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave ParkPython - Getting to the Essence - Points.com - Dave Park
Python - Getting to the Essence - Points.com - Dave Park
 
Perl Teach-In (part 1)
Perl Teach-In (part 1)Perl Teach-In (part 1)
Perl Teach-In (part 1)
 
BASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic InterpolationBASH Variables Part 1: Basic Interpolation
BASH Variables Part 1: Basic Interpolation
 
OOP is more than Cars and Dogs
OOP is more than Cars and Dogs OOP is more than Cars and Dogs
OOP is more than Cars and Dogs
 
Introduction to Modern Perl
Introduction to Modern PerlIntroduction to Modern Perl
Introduction to Modern Perl
 
Effective Benchmarks
Effective BenchmarksEffective Benchmarks
Effective Benchmarks
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013Bioinformatics p1-perl-introduction v2013
Bioinformatics p1-perl-introduction v2013
 
Getting testy with Perl
Getting testy with PerlGetting testy with Perl
Getting testy with Perl
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 

Similar to WebAssembly. Neither Web Nor Assembly, All Revolutionary

Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly LanguageMotaz Saad
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisC4Media
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsLeonardo Borges
 
String Comparison Surprises: Did Postgres lose my data?
String Comparison Surprises: Did Postgres lose my data?String Comparison Surprises: Did Postgres lose my data?
String Comparison Surprises: Did Postgres lose my data?Jeremy Schneider
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolscharsbar
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Going crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHPGoing crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHPMariano Iglesias
 
Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CDavid Wheeler
 
DevOps in PHP environment
DevOps in PHP environmentDevOps in PHP environment
DevOps in PHP environmentEvaldo Felipe
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Michael Rys
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript DevelopmentJussi Pohjolainen
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 

Similar to WebAssembly. Neither Web Nor Assembly, All Revolutionary (20)

Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
 
String Comparison Surprises: Did Postgres lose my data?
String Comparison Surprises: Did Postgres lose my data?String Comparison Surprises: Did Postgres lose my data?
String Comparison Surprises: Did Postgres lose my data?
 
ELAG Workshop version 1
ELAG Workshop version 1ELAG Workshop version 1
ELAG Workshop version 1
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Php extensions
Php extensionsPhp extensions
Php extensions
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
2009-02 Oops!
2009-02 Oops!2009-02 Oops!
2009-02 Oops!
 
Going crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHPGoing crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHP
 
Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning C
 
DevOps in PHP environment
DevOps in PHP environmentDevOps in PHP environment
DevOps in PHP environment
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)
 
Json generation
Json generationJson generation
Json generation
 
Advanced JavaScript Development
Advanced JavaScript DevelopmentAdvanced JavaScript Development
Advanced JavaScript Development
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 

More from C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

More from C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Recently uploaded

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

WebAssembly. Neither Web Nor Assembly, All Revolutionary

  • 1. WebAssemblyneither Web nor Assembly, but Revolutionary Jay Phelps | @_jayphelps
  • 2. InfoQ.com: News & Community Site • Over 1,000,000 software developers, architects and CTOs read the site world- wide every month • 250,000 senior developers subscribe to our weekly newsletter • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • 2 dedicated podcast channels: The InfoQ Podcast, with a focus on Architecture and The Engineering Culture Podcast, with a focus on building • 96 deep dives on innovative topics packed as downloadable emags and minibooks • Over 40 new content items per week Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ webassembly-intro
  • 3. Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide Presented at QCon San Francisco www.qconsf.com
  • 4. Jay Phelps | @_jayphelps The WebAssembly revolution has begun
  • 5. Chief Software Architect | previously Jay Phelps @_jayphelps
  • 6. Support, Dev Rel, Staff Augmentation, Mentorship, and more www.thisdot.co
  • 7. Jay Phelps | @_jayphelps So...what is WebAssembly? aka Wasm
  • 8. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Web
  • 9. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Web
  • 10. Jay Phelps | @_jayphelps Fast to load and execute
  • 11. Jay Phelps | @_jayphelps Streaming compilation compiled to machine code faster than it downloads
  • 12.
  • 13.
  • 14. (func $0 (type 0) i32.const 0 i32.load ) (func $1 (type 0) i32.const 0 i32.load ) (func $2 (type 0) i32.const 0 i32.load ) (func $3 (type 0) i32.const 0 i32.load ) .wasm
  • 15. (func $0 (type 0) i32.const 0 i32.load ) (func $1 (type 0) i32.const 0 i32.load ) (func $2 (type 0) i32.const 0 i32.load ) (func $3 (type 0) i32.const 0 i32.load ) .wasm machine code
  • 16. (func $0 (type 0) i32.const 0 i32.load ) (func $1 (type 0) i32.const 0 i32.load ) (func $2 (type 0) i32.const 0 i32.load ) (func $3 (type 0) i32.const 0 i32.load ) .wasm machine code
  • 17. wasm-function[0]: sub rsp, 8 mov eax, dword ptr [r15] nop add rsp, 8 wasm-function[1]: sub rsp, 8 mov eax, dword ptr [r15] nop add rsp, 8 wasm-function[2]: sub rsp, 8 mov eax, dword ptr [r15] nop add rsp, 8 wasm-function[3]: sub rsp, 8 mov eax, dword ptr [r15] nop add rsp, 8 .wasm machine code
  • 18. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Websafe
  • 19. Jay Phelps | @_jayphelps Sandboxed and designed with security in mind Control-flow integrity checks, stack protection, dynamic dispatch table separate from linear memory
  • 20. Jay Phelps | @_jayphelps However, does not prevent all classes of exploits Code reuse, side channel, race conditions, etc
  • 21. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Weblow-level bytecode
  • 22. Jay Phelps | @_jayphelps WebAssembly is a portable, binary instruction set for a virtual machine
  • 23. Jay Phelps | @_jayphelps 0x6a01101010 (the i32.add instruction)
  • 24. Jay Phelps | @_jayphelps Intended (mostly) as a compilation target
  • 25. int factorial(int n) { if (n == 0) { return 1; } else { return n * factorial(n - 1); } }
  • 26. int factorial(int n) { if (n == 0) { return 1; } else { return n * factorial(n - 1); } } 00 61 73 6D 01 00 00 00 01 86 80 80 80 00 01 60 01 7F 01 7F 03 82 80 80 80 00 01 00 06 81 80 80 80 00 00 0A 9D 80 80 80 00 01 97 80 80 80 00 00 20 00 41 00 46 04 40 41 01 0F 0B 20 00 41 01 6B 10 00 20 00 6C 0B
  • 27. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Web
  • 28. Jay Phelps | @_jayphelps How did we get here?
  • 29. Jay Phelps | @_jayphelps Primary goals: languages other than JavaScript and great—ideally improved—performance
  • 30. Jay Phelps | @_jayphelps Java Applets Never truly integrated into browsers
  • 31. Jay Phelps | @_jayphelps Why not integrate the JVM or CLR? misaligned goals, mostly related to validation/compiling
  • 32. Jay Phelps | @_jayphelps Portable Native Client (PNaCl) lead by Google
  • 33. Jay Phelps | @_jayphelps asm.js lead by Mozilla
  • 34. size_t strlen(char *ptr) { char *curr = ptr; while (*curr != 0) { curr++; } return (curr - ptr); } "use asm" function strlen(ptr) { ptr = ptr|0; var curr = 0; curr = ptr; while (MEM8[curr]|0 != 0) { curr = (curr + 1)|0; } return (curr - ptr)|0; } asm.jsC
  • 35. ! Jay Phelps | @_jayphelps WebAssembly !
  • 36. Jay Phelps | @_jayphelps WebAssembly is an unprecedented collaboration
  • 37. Jay Phelps | @_jayphelps The first open and standardized bytecode
  • 38. Jay Phelps | @_jayphelps Is it going to kill JavaScript?
  • 39. Jay Phelps | @_jayphelps Is it going to kill JavaScript?
  • 40. Jay Phelps | @_jayphelps Nope!
  • 41. Jay Phelps | @_jayphelps Will we compile JavaScript to WebAssembly?
  • 42. Jay Phelps | @_jayphelps JavaScript is an extremely dynamic language
  • 43.
  • 44. Jay Phelps | @_jayphelps Fully spec compliant JavaScript compiled to WebAssembly would be slower
  • 45. Jay Phelps | @_jayphelps …but a strict subset of JavaScript could be fast!
  • 46.
  • 47.
  • 48. Jay Phelps | @_jayphelps WebAssembly v1 MVP is best suited for languages like C/C++ and Rust
  • 49. Jay Phelps | @_jayphelps Ideal for relatively low-level, system languages Very little dynamic features at run-time, no GC
  • 50. Jay Phelps | @_jayphelps Some modern features of C++ don’t perform ideal
  • 51. Jay Phelps | @_jayphelps Exceptions are the most common example
  • 52. Jay Phelps | @_jayphelps But other languages are already supported, and more planned Things like Go, .NET, Java, OCaml, and even new ones
  • 53. Jay Phelps | @_jayphelps WebAssembly will impact language design and implementation
  • 54. Jay Phelps | @_jayphelps The Web requires unique considerations
  • 55. Jay Phelps | @_jayphelps Rust team has specifically called out WebAssembly as a priority
  • 56. Jay Phelps | @_jayphelps File sizes as well as lazy-loading/code splitting, caching, etc
  • 57. Jay Phelps | @_jayphelps Shared libraries Traditional platforms like iOS/Android/macOS/ Windows have more robust stdlibs and UI toolkits
  • 58. Jay Phelps | @_jayphelps Offline Caching story much more complex than desktop
  • 59. Jay Phelps | @_jayphelps Interop with JavaScript Languages which better interop with JS have major advantage
  • 60. Jay Phelps | @_jayphelps Promising: Dart, Elm, Reason Languages designed for the Web
  • 61. Jay Phelps | @_jayphelps a TypeScript-like language? AssemblyScript is an early example
  • 62. Jay Phelps | @_jayphelps export function factorial(n: i32): i32 { if (n == 0) { return 1; } else { return n * factorial(n - 1); } } AssemblyScript
  • 63. Jay Phelps | @_jayphelps When should I target WebAssembly right now?
  • 64. Jay Phelps | @_jayphelps Heavily CPU-bound number computations
  • 65. Jay Phelps | @_jayphelps Games both Unity and Unreal Engine offer support
  • 66. Jay Phelps | @_jayphelps Using existing portable code e.g. video/audio decoders and other processing
  • 67. Jay Phelps | @_jayphelps bcrypt OpenCV mcl bls web-dsp hunspell XSalsa20 GDAL SPHINCS NTRUxxHash RLWE McEliece Zopfli SIDH ttf2woff2
  • 68. Jay Phelps | @_jayphelps Zoom for Web client Video conferencing powered by WebAssembly, video/audio decoding off the main thread
  • 70. Jay Phelps | @_jayphelps Web UI developers are probably already using WebAssembly without knowing it!
  • 71. Jay Phelps | @_jayphelps source-map npm package 10.9x faster! used by Firefox, Babel, create-react-app, LESS, etc
  • 72. Jay Phelps | @_jayphelps Other use cases are just around the corner
  • 73. Jay Phelps | @_jayphelps What was that binary stuff?
  • 74. int factorial(int n) { if (n == 0) { return 1; } else { return n * factorial(n - 1); } } 00 61 73 6D 01 00 00 00 01 86 80 80 80 00 01 60 01 7F 01 7F 03 82 80 80 80 00 01 00 06 81 80 80 80 00 00 0A 9D 80 80 80 00 01 97 80 80 80 00 00 20 00 41 00 46 04 40 41 01 0F 0B 20 00 41 01 6B 10 00 20 00 6C 0B
  • 75. 00 61 73 6D 01 00 00 00 01 86 80 80 80 00 01 60 01 7F 01 7F 03 82 80 80 80 00 01 00 06 81 80 80 80 00 00 0A 9D 80 80 80 00 01 97 80 80 80 00 00 20 00 41 00 46 04 40 41 01 0F 0B 20 00 41 01 6B 10 00 20 00 6C 0B
  • 76. 00 61 73 6D 01 00 00 00 01 86 80 80 80 00 01 60 01 7F 01 7F 03 82 80 80 80 00 01 00 06 81 80 80 80 00 00 0A 9D 80 80 80 00 01 97 80 80 80 00 00 20 00 41 00 46 04 40 41 01 0F 0B 20 00 41 01 6B 10 00 20 00 6C 0B
  • 77. 00 61 73 6D 01 00 00 00 01 86 80 80 80 00 01 60 01 7F 01 7F 03 82 80 80 80 00 01 00 06 81 80 80 80 00 00 0A 9D 80 80 80 00 01 97 80 80 80 00 00 20 00 41 00 46 04 40 41 01 0F 0B 20 00 41 01 6B 10 00 20 00 6C 0B
  • 78. 03 82 80 80 80 0 81 80 80 80 00 0 80 80 00 01 97 8 00 20 00 41 00 4
  • 79. 03 82 80 80 80 0 81 80 80 80 00 0 80 80 00 01 97 8 00 20 00 41 00 4
  • 80. 03 82 80 80 80 0 81 80 80 80 00 0 80 80 00 01 97 8 00 20 00 41 00 4
  • 81. Jay Phelps | @_jayphelps Binary can be a little intimidating
  • 82. Jay Phelps | @_jayphelps Protip: don't worry about it (unless of course, you want to)
  • 83. Jay Phelps | @_jayphelps Tooling will eventually make it a non-issue
  • 84. Jay Phelps | @_jayphelps Textual representation to the rescue!
  • 85. Jay Phelps | @_jayphelps (func $factorial (param $n i32) (result i32) get_local $n i32.const 0 i32.eq if $if0 i32.const 1 return end $if0 get_local $n i32.const 1 i32.sub call $factorial get_local $n i32.mul )
  • 86. Jay Phelps | @_jayphelps (func $factorial (param $n i32) (result i32) get_local $n i32.const 0 i32.eq if $if0 i32.const 1 return end $if0 get_local $n i32.const 1 i32.sub call $factorial get_local $n i32.mul )
  • 87. Jay Phelps | @_jayphelps Let's learn the fundamentals
  • 88. Jay Phelps | @_jayphelps WebAssembly is a stack machine
  • 89. Jay Phelps | @_jayphelps ...what's a stack machine?
  • 90. Jay Phelps | @_jayphelps a data structure with two operations: push and pop Stack
  • 91. Jay Phelps | @_jayphelps stack machine: instructions on a stack
  • 92. Jay Phelps | @_jayphelps Why a stack machine? instead of AST, SSA, or register machine
  • 93. Jay Phelps | @_jayphelps Smaller binary encoding, easier and faster single pass verification and VM implementation
  • 94. 1 + 2
  • 106. i32.const 1 i32.const 2 i32.add Jay Phelps | @_jayphelps
  • 107. i32.const 1 i32.const 2 i32.add call $log Jay Phelps | @_jayphelps
  • 108. Jay Phelps | @_jayphelps What's missing?
  • 109. Jay Phelps | @_jayphelps Direct access to Host APIs (e.g. the DOM) no direct access to sys calls, you have to call into JavaScript
  • 110. Jay Phelps | @_jayphelps Garbage collection necessary for better interop with JavaScript and WebIDL (e.g. the DOM)
  • 111. Jay Phelps | @_jayphelps Multi-threading SharedArrayBuffer re-enabled in Chrome 68
  • 112. Jay Phelps | @_jayphelps Single Instruction Multiple Data (SIMD) Hardware parallelization of vector computations
  • 113. Jay Phelps | @_jayphelps Zero-cost exceptions someday maybe even Algebraic Effects (!!!)
  • 114. Jay Phelps | @_jayphelps There's more, but advancing quickly!
  • 115. Jay Phelps | @_jayphelps How do I get started?
  • 116. Jay Phelps | @_jayphelps webassembly.org
  • 117. Jay Phelps | @_jayphelps https://github.com/mbasso/awesome-wasm
  • 118. Supported in all modern browsers
  • 119. Jay Phelps | @_jayphelps The revolution is just beginning
  • 120. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Web
  • 121. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Web?
  • 122. Jay Phelps | @_jayphelps The first open and standardized bytecode
  • 123.
  • 124.
  • 125. Jay Phelps | @_jayphelps WebAssembly is not just for the Web!
  • 126.
  • 127. ewasm Etherium-flavored WebAssembly VM for running distributed smart contracts
  • 128. rianhunter/wasmjit VM and Linux kernel module for running WebAssembly in “ring 0”
  • 129. nebulet microkernel that runs WebAssembly exclusively
  • 130. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Web
  • 131. Jay Phelps | @_jayphelps Efficient, safe, low-level bytecode for the Web
  • 132. Jay Phelps | @_jayphelps Thanks! @_jayphelps
  • 133. Watch the video with slide synchronization on InfoQ.com! https://www.infoq.com/presentations/ webassembly-intro