SlideShare a Scribd company logo
1 of 40
Download to read offline
Portable, secure and
lightweight: Wasm
runtimes and use-
cases
Wey Wey Web - Málaga | November 2023
Natalia Venditto
microfrontend.dev - @anfibiacreativa
Image credit DALL-E3
What makes
JavaScript that
popular?
© Austin Neil | Unsplash.com
The JavaScript
ecosystem is like the
Universe...
© Ivana Cajina | Unsplash.com
...hosting 16M
developers
worldwide.
© NASA | Unsplash.com
From 1.9 billion websites, 98% use
JavaScript.
https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/
microfrontend.dev - @anfibiacreativa
const = 49%;
const = 63%;
pythonDevsWorldwide
javaScriptDevsWorldwide
Natalia Venditto
aka anfibiacreativa
Principal JavaScript DX Lead Microsoft Azure
Google Developer Expert for Angular and Web Technologies (Runtime Performance)
Author of https://microfrontend.dev
2021 Microsoft Most Valuable Professional
PARSER
INTERPRETER
COMPILER
AST
Bytes
Optimized
Code
010101
101010
010101
Script
microfrontend.dev - @anfibiacreativa
010101
101010
010101
AST ByteCode
Machine
code
Script
010101
101010
PARSER INTERPRETER COMPILER
microfrontend.dev - @anfibiacreativa
const = [ , ,...{} ]
High performance.
At low level, we perform better.
microfrontend.dev - @anfibiacreativa
© SpaceX | Unsplash.com
8" attention span
just a little
patience!
(function() {
let patience = 8;
function runOutofPatience() {
patience--;
if (patience <= 0) {
clearInterval(secondGone);
console.log("This site is slow. Bye.");
} else {
console.log(`I got this ${patience} left`);
}
}
const secondGone = setInterval(runOutofPatience, 1000);
})();
Runtime
CLIENT
Clientside Rendering
¿Where? ¿When?
We don't know the system
capacity or
connection capabilities, of
the user at any time, which
can impact latency and
code execution at runtime.
Metaframeworks
Frameworks that are built on top of
other JavaScript frameworks or
libraries, typically offering additional
capabilities, like static generation, server
side rendering, progressive hydration,
etc.
microfrontend.dev - @anfibiacreativa
Runtime
SERVER
Serverside Rendering (SSR)
Typically implement
aggressive server-side
caching techniques and
selective progressive
hydration for dynamic
areas of content in the
HTML.
¿Where? ¿When?
Combining or composing statically
generated pages or server-side
rendered HTML snippets, with
dynamic and serialized elements,
like state and other computed
data.
Can run on the JavaScript main
thread or a worker, also with
Wasm.
microfrontend.dev - @anfibiacreativa
microfrontend.dev - @anfibiacreativa
Use case.
Pagefind, a Wasm search component.
microfrontend.dev - @anfibiacreativa
https://starlight.astro.build/
Designed as a portable binary
target, fully sand-boxed...it is a web
platform standard.
microfrontend.dev - @anfibiacreativa
microfrontend.dev - @anfibiacreativa
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
microfrontend.dev - @anfibiacreativa
010101
101010
010101
TOOLCHAIN
Wasm
Wasm
imported to
JavaScript
Program
010101
101010
010101
TOOLCHAIN Wasm
Wasm
imported to
JavaScript
Program
microfrontend.dev - @anfibiacreativa
Imports/Exports
microfrontend.dev - @anfibiacreativa
fetch("hello_world.wasm")
.then(response => response.arrayBuffer())
.then(bytes => {
const wasmModule = WebAssembly.compile(bytes);
const instance = new WebAssembly.Instance(wasmModule, {
env: {
println: console.log
}
});
instance.exports.hello_world();
});
1
2
3
4
5
6
7
8
9
10
11
(module
(import 'env' 'println'func $println (param i32)))
(func $hello_world (export 'hello_world')
(block $block
(call $println
(i32.const 0))
))
(memory 1)
(data (i32.const 0)'Hello, Wey Wey Web for UI Lovers') ))
1
2
3
4
5
6
7
8
9
fetch/instaciate
microfrontend.dev - @anfibiacreativa
fetch("hello_world.wasm")
1
.then(response => response.arrayBuffer())
2
.then(bytes => {
3
const wasmModule = WebAssembly.compile(bytes);
4
const instance = new WebAssembly.Instance(wasmModule, {
5
env: {
6
println: console.log
7
}
8
});
9
instance.exports.hello_world();
10
});
11
.then(response => response.arrayBuffer())
fetch("hello_world.wasm")
1
2
.then(bytes => {
3
const wasmModule = WebAssembly.compile(bytes);
4
const instance = new WebAssembly.Instance(wasmModule, {
5
env: {
6
println: console.log
7
}
8
});
9
instance.exports.hello_world();
10
});
11
const wasmModule = WebAssembly.compile(bytes);
const instance = new WebAssembly.Instance(wasmModule, {
fetch("hello_world.wasm")
1
.then(response => response.arrayBuffer())
2
.then(bytes => {
3
4
5
env: {
6
println: console.log
7
}
8
});
9
instance.exports.hello_world();
10
});
11
instance.exports.hello_world();
fetch("hello_world.wasm")
1
.then(response => response.arrayBuffer())
2
.then(bytes => {
3
const wasmModule = WebAssembly.compile(bytes);
4
const instance = new WebAssembly.Instance(wasmModule, {
5
env: {
6
println: console.log
7
}
8
});
9
10
});
11
Portability.
Parity between execution contexts.
microfrontend.dev - @anfibiacreativa
Even in the
lightbulbs.
© Anthony Indraus | Unsplash.com
ADDITIONAL
INTERFACES
microfrontend.dev - @anfibiacreativa
010101
101010
010101
TOOLCHAIN
Wasm
Wasm
imported to
JavaScript
Program
010101
101010
010101
TOOLCHAIN Wasm
Wasm
imported to
JavaScript
Program
microfrontend.dev - @anfibiacreativa
ADDITIONAL
INTERFACES
Modular system inteface built for
WebAssembly, outside of the
browser, fully compatible with
POSIX systems.
It is a standard IN PREVIEW.
microfrontend.dev - @anfibiacreativa
microfrontend.dev - @anfibiacreativa
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
010101
101010
010101
It is run in specific runtimes, like
Wasmtime.
Isomorphism
Isomorphic apps allow the execution of
the same code, in different
environments.
JavaScript enables both isomorphism
and trisomorphism, leveraging browser
and remote workers.
microfrontend.dev - @anfibiacreativa
Demo
...shared memories, that can be transfered
between the Window and the worker with
...[].
postMessage()
Composable user interfaces of this
type, are built or composed
remotely, typically in a worker
running at the edge of the
network (mostly on CDN PoPs very
close to the end-user).
microfrontend.dev - @anfibiacreativa
Security.
Fully sand-boxed and memory-safe.
microfrontend.dev - @anfibiacreativa
© Piron Guillaume | Unsplash.com
Trade-offs?
Sure.
microfrontend.dev - @anfibiacreativa
There are more layers
to debug to
understand the source
of an issue.
This new
technologies are in
preview and hence
unstable and prone
to change API defs.
Not all the interfaces are
available for every
language.
microfrontend.dev - @anfibiacreativa
DEV OPS
ARQ
Development
Specification
Setup
Design
Integration
Delivery
Operations
D
E
P
L
O
Y
M
E
N
T
DESIGN
D
E
V
E
L
O
P
M
E
N
T
microfrontend.dev - @anfibiacreativa
Thank you!
@anfibiacreativa - https://www.microfrontend.dev
Bytecode Alliance Javy WebAssembly.org
Microfrontend.dev Bjorn3 WASI shim Wasmtime Demo
Learn more

More Related Content

Similar to Portable, secure, and lightweight: Wasm runtimes and their use-cases - Natalia Venditto

Why Node.js
Why Node.jsWhy Node.js
Why Node.js
guileen
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mohammad Shaker
 

Similar to Portable, secure, and lightweight: Wasm runtimes and their use-cases - Natalia Venditto (20)

Java vs. Java Script for enterprise web applications - Chris Bailey
Java vs. Java Script for enterprise web applications - Chris BaileyJava vs. Java Script for enterprise web applications - Chris Bailey
Java vs. Java Script for enterprise web applications - Chris Bailey
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
Why Nodejs Guilin Shanghai
Why Nodejs Guilin ShanghaiWhy Nodejs Guilin Shanghai
Why Nodejs Guilin Shanghai
 
Why Node.js
Why Node.jsWhy Node.js
Why Node.js
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Server
 
Electron Firenze 2020: Linux, Windows o MacOS?
Electron Firenze 2020: Linux, Windows o MacOS?Electron Firenze 2020: Linux, Windows o MacOS?
Electron Firenze 2020: Linux, Windows o MacOS?
 
Electron: Linux, Windows or Macos?
Electron: Linux, Windows or Macos?Electron: Linux, Windows or Macos?
Electron: Linux, Windows or Macos?
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
UniRx - Reactive Extensions for Unity(EN)
UniRx - Reactive Extensions for Unity(EN)UniRx - Reactive Extensions for Unity(EN)
UniRx - Reactive Extensions for Unity(EN)
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
 
(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe(In)Security Implication in the JS Universe
(In)Security Implication in the JS Universe
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web
 
MunichJS - node.js - from the beginning
MunichJS - node.js - from the beginningMunichJS - node.js - from the beginning
MunichJS - node.js - from the beginning
 
Reactive microservices with Micronaut - GR8Conf EU 2018
Reactive microservices with Micronaut - GR8Conf EU 2018Reactive microservices with Micronaut - GR8Conf EU 2018
Reactive microservices with Micronaut - GR8Conf EU 2018
 
Node azure
Node azureNode azure
Node azure
 
Testing frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabsTesting frontends with nightwatch & saucelabs
Testing frontends with nightwatch & saucelabs
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 

More from Wey Wey Web

More from Wey Wey Web (20)

Auditing Design Systems for Accessibility - Anna E. Cook
Auditing Design Systems for Accessibility - Anna E. CookAuditing Design Systems for Accessibility - Anna E. Cook
Auditing Design Systems for Accessibility - Anna E. Cook
 
Adaptive Designs, Beyond Pixel Perfection - Stephanie Walter
Adaptive Designs, Beyond Pixel Perfection - Stephanie WalterAdaptive Designs, Beyond Pixel Perfection - Stephanie Walter
Adaptive Designs, Beyond Pixel Perfection - Stephanie Walter
 
Sharing is caring: what to know before you build a Research Repository - Juli...
Sharing is caring: what to know before you build a Research Repository - Juli...Sharing is caring: what to know before you build a Research Repository - Juli...
Sharing is caring: what to know before you build a Research Repository - Juli...
 
Unlocking collaboration: A framework for developers and designers - Alicia Ca...
Unlocking collaboration: A framework for developers and designers - Alicia Ca...Unlocking collaboration: A framework for developers and designers - Alicia Ca...
Unlocking collaboration: A framework for developers and designers - Alicia Ca...
 
3 reasons to switch to OKLCH - Anton Lovchikov
3 reasons to switch to OKLCH - Anton Lovchikov3 reasons to switch to OKLCH - Anton Lovchikov
3 reasons to switch to OKLCH - Anton Lovchikov
 
ChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano FirtmanChatGPT and AI for web developers - Maximiliano Firtman
ChatGPT and AI for web developers - Maximiliano Firtman
 
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023Declarative Design - Jeremy Keith - Wey Wey Wey 2023
Declarative Design - Jeremy Keith - Wey Wey Wey 2023
 
Form follows emotion - Isabella De Cuppis
Form follows emotion - Isabella De CuppisForm follows emotion - Isabella De Cuppis
Form follows emotion - Isabella De Cuppis
 
UX for emerging tech - Josephine Scholtes
UX for emerging tech - Josephine ScholtesUX for emerging tech - Josephine Scholtes
UX for emerging tech - Josephine Scholtes
 
Collaborative software with State Machines - Laura Kalbag
Collaborative software with State Machines -  Laura KalbagCollaborative software with State Machines -  Laura Kalbag
Collaborative software with State Machines - Laura Kalbag
 
Lessons Learned from building Session Replay - Francesco Novy
Lessons Learned from building Session Replay - Francesco NovyLessons Learned from building Session Replay - Francesco Novy
Lessons Learned from building Session Replay - Francesco Novy
 
Let's get visual. Visual testing in your project - Ramona Schwering
Let's get visual. Visual testing in your project - Ramona SchweringLet's get visual. Visual testing in your project - Ramona Schwering
Let's get visual. Visual testing in your project - Ramona Schwering
 
Solving Common Web Component Problems - Simon MacDonald
Solving Common Web Component Problems - Simon MacDonaldSolving Common Web Component Problems - Simon MacDonald
Solving Common Web Component Problems - Simon MacDonald
 
The Future is Malleable - Aleksandra Sikora
The Future is Malleable - Aleksandra SikoraThe Future is Malleable - Aleksandra Sikora
The Future is Malleable - Aleksandra Sikora
 
Trending tools & methodologies for UX - Josephine Scholtes.pdf
Trending tools & methodologies for UX - Josephine Scholtes.pdfTrending tools & methodologies for UX - Josephine Scholtes.pdf
Trending tools & methodologies for UX - Josephine Scholtes.pdf
 
Decoding Web Accessibility through Testing - Anuradha Kumari
Decoding Web Accessibility through Testing  - Anuradha KumariDecoding Web Accessibility through Testing  - Anuradha Kumari
Decoding Web Accessibility through Testing - Anuradha Kumari
 
Good Security is one question away - Wiktoria Dalach
Good Security is one  question away - Wiktoria DalachGood Security is one  question away - Wiktoria Dalach
Good Security is one question away - Wiktoria Dalach
 
Dynamic CSS Secrets - Lea Verou
Dynamic CSS Secrets - Lea Verou Dynamic CSS Secrets - Lea Verou
Dynamic CSS Secrets - Lea Verou
 
The Misty Report - Douglas Crockford
The Misty Report - Douglas CrockfordThe Misty Report - Douglas Crockford
The Misty Report - Douglas Crockford
 
Web performance optimisations for the harsh conditions - Anna Migas
Web performance optimisations for the harsh conditions - Anna MigasWeb performance optimisations for the harsh conditions - Anna Migas
Web performance optimisations for the harsh conditions - Anna Migas
 

Recently uploaded

Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Recently uploaded (20)

ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 

Portable, secure, and lightweight: Wasm runtimes and their use-cases - Natalia Venditto