SlideShare a Scribd company logo
1
Practical WebAssembly
@jsoverson
How To Get The Most Out Of Vanilla WASM
Who here
has used WebAssembly?
@jsoverson
Who here
uses WebAssembly now?
@jsoverson
thinks the WebAssembly experience is
straightforward and intuitive?
@jsoverson
Who here
5
WebAssembly
is dif
fi
cult because it
can be anything
WebAssembly Isn't Easy
@jsoverson
For two reasons
It Changes What Is Possible In Software
1
It unlocks potential we've never had before.
2
WebAssembly Isn't Easy
@jsoverson
For two reasons
1 It Changes What Is Possible In Software
Everyone's Still Figuring Out 1
There are many questions, few answers, and myriad parallel solutions
WebAssembly standardizes logic
Containers standardized processes
The Last Artifact
@jsoverson
WebAssembly is the
fi
nal step in standardizing distribution
VMs standardized the OS & environment
There is no next step. This is all software.
VMs standardized the OS & environment
• Author, Web Expert, & Lifelong Hacker
• CTO Candle
Jarrod Overson
@jsoverson
Posts about WebAssembly,
Security, and JS/Rust topics here
Looks like this
10
1
2
3
Understanding Fragmentation
Bridging The Gap
Building Something Real
Agenda
Flavors of WASM
Vanilla WASM WASI WASI Proposals
WASM Proposals
Plain ol' WebAssembly that adheres to the MVP spec.
Runs everywhere.
Browser:
Server:
Baseline Extensions
@jsoverson
Flavors of WASM
WASI WASI Proposals
WASM Proposals
WebAssembly that leverages early proposal implementations (e.g. threads).
Support is variable.
Browser:
Server:
Baseline
Vanilla WASM
+
@jsoverson
Extensions
Flavors of WASM
WASI WASI Proposals
WASM Proposals
WebAssembly that targets the WASI (WebAssembly Systems Interface) spec.
Great support on server side. Not tailored to browsers.
Browser:
Server:
Baseline
Vanilla WASM
+
@jsoverson
Extensions
Flavors of WASM
WASI WASI Proposals
WASM Proposals
WebAssembly that leverages early WASI proposal implementations (e.g. sockets).
Support is universally poor.
Browser:
Server:
Baseline
Vanilla WASM
+
@jsoverson
Extensions
Flavors of WASM
SDKs
Platform-speci
fi
c SDKs that leverage speci
fi
c host features.
Compatibility is tied to host compatibility.
Browser:
Server:
-
-
Baseline
Vanilla WASM
+
@jsoverson
Honorable
Mention
WASI WASI Proposals
WASM Proposals
Just Because It's WebAssembly
Doesn't Mean It's Portable
@jsoverson
Lessons From JavaScript
The community tried to make a universal module format with JavaScript, but we had
momentum working against us
Mobile:
Server:
Other:
JavaScript + DOM + WebView APIs
JavaScript + Server (e.g. Node) APIs
JavaScript + Random stuff
Browser: JavaScript + DOM
@jsoverson
Lessons From JavaScript
The community tried to make a universal module format with JavaScript, but we had
momentum working against us
Mobile:
Server:
Other:
JavaScript + DOM + WebView APIs
JavaScript + Server (e.g. Node) APIs
JavaScript + Random stuff
Browser: JavaScript + DOM
We tried to write tools that would shim and transpile everything that wasn't core JS into core JS.
It was an arms race. We never ful
fi
lled the vision.
The Opportunity With WASM
We have a baseline already. It's up to the community to preserve it.
Mobile:
Server:
Other:
WebAssembly
WebAssembly + WASI
WebAssembly
Browser: WebAssembly
WASI is great for entrypoints like CLI apps and servers, but it's not critical for most libraries.
If our libraries accept WASM/WASI as a default we turn our nose up at 1 billion+ devices.
20
1
2
3
Understanding Fragmentation
Bridging The Gap
Building Something Real
Agenda
What we want
@jsoverson
Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible.
1
2
3
4
Rich data types
Asynchronous operations
Automatic linking
Generated bindings
4
What we want
@jsoverson
Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible.
1
2
3
Rich data types
Asynchronous operations
Automatic linking
Generated bindings
Future: Component Model
Now: Apex + wasmRS
What we want
@jsoverson
Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible.
1
2
3
4
Rich data types
Asynchronous operations
Automatic linking
Generated bindings
Future: Threads, sort of and ...?
Now: wasmRS
What we want
@jsoverson
Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible.
1
2
3
4
Rich data types
Asynchronous operations
Automatic linking
Generated bindings
Future: WIT & wit-bindgen
Now: Apex
WIT & Apex
@jsoverson
WIT Apex
Both are IDLs. Both are interpreted by generators to
generate code that would be cumbersome and error-prone to write by hand.
WIT is a project tailored to the WebAssembly component model and
fl
uctuates as
proposals
fl
uctuate.
Apex is generic and use-case agnostic. It's a good parent IDL.
Until the component model
@jsoverson
Apex can help generate bindings, boilerplate, and
integration code for WebAssembly today.
https://apexlang.io
After the component model
@jsoverson
Apex can generate WIT and wit-bindgen can
generate bindings
WIT
https://apexlang.io
After the component model
@jsoverson
You can throwaway Apex or keep using it
generate other artifacts.
JSON Schema
API impls
Docs
WIT
https://apexlang.io
Async Operations + Rich Data
@jsoverson
The wasmRS suite gives us reactive streams in and out of WebAssembly
wasmRS
WebAssembly
wasmRS opens a socket into WebAssembly with bidirectional streams complete with
backpressure and fragmentation.
wasmRS will exist for a long time and will incorporate standards as they land.
https://github.com/nanobus/iota
Years of Production Experience
@jsoverson
wasmRS takes lessons learned from waPC and pushes ideas further
Complex Data Errors Host/Guest calls
Browser-
compatible
Reactive
Streams
Async
Operations
waPC
wasmRS
Both give developers a common way of interfacing with Vanilla WebAssembly.
Both have support for multiple languages on the guest and the host side.
waPC will continue to work while the future is wasmRS.
https://github.com/nanobus/iota
Automatic Linking
@jsoverson
Components built with Apex & wasmRS contain the data necessary to understand how
they connect to others.
and their exports
Components declare
their imports
A runtime can connect them all, automatically
Nanobus
@jsoverson
Nanobus connects disparate components into one running application.
microservice
iota
low-code
iota
wasm
iota
wasm iota
Components
(we call them iotas)
postgres
redis
etc
External services
Nanobus
runtime
https://github.com/nanobus/nanobus
2
33
1
3
Understanding Fragmentation
Bridging The Gap
Building Something Real
Agenda
34
URL Shortener
First, we
fi
gure out the interface we want to expose
In this case, we need two methods...
...each take a string... ...and return a string
shorten
URL ID
lookup
ID URL
35
URL Shortener
What it looks like de
fi
ned in Apex.
Apex looks like code but it's just con
fi
guration.
36
Where Do We Store URLs?
shorten
URL ID
???
We could store them in a database, but then we tie ourselves to a storage implementation.
It makes our component less reusable and DEV/QA/PROD testing more dif
fi
cult.
37
Where Do We Store URLs?
shorten
URL ID
storeUrl(id, url)
It's easier to ignore the implementation completely.
38
Where Do We Store URLs?
We can de
fi
ne our interface and leave the implementation for later.
39
The Component Definition
@service tags what we deliver (export), @provider tags what we need (import).
Note: these are Apex directives.
Directives extend Apex for
project-speci
fi
c purposes like
nanobus
40
Generating Everything
Let the apex CLI or the VSCode plugin generate everything automatically.
41
42
43
This is the business logic. That's it.
44
In lookup() there is zero unique logic. We're just calling the storage provider.
We don't need code for that. We can get rid of it.
After compiling, we end up with a wasm binary from 1 line of business logic.
Implementing Our URL
Repository Provider
But hold up...
How much of the code you write to persist data or query
databases is actually unique and valuable?
46
Components don't need to be WebAssembly
Code that already exists.
Our Repository component then
becomes 100% con
fi
guration.
We de
fi
ne our Repository component in
terms of its namespace and interface name
47
Adding our WebAssembly
48
We turned what amounts to a library with 1 line of business logic
into a database-backed web service by reusing existing components and connecting them together
WebAssembly Is Ready Now
1 The Investment Will Pay Off
@jsoverson
WebAssembly Is Ready Now
1
2
The Investment Will Pay Off
Be Bold and Uncompromising
@jsoverson
WebAssembly Is Ready Now
1
2
3
The Investment Will Pay Off
Be Bold and Uncompromising
Software Is Changing, Be Ready For It.
Thank you!
@jsoverson
https://apexlang.io
https://github.com/nanobus/nanobus
https://github.com/nanobus/iota
https://github.com/nanobus/examples
apex:
nanobus:
wasmrs:
examples:
candle.dev
Appendix
Ad

More Related Content

Similar to Practical WebAssembly with Apex, wasmRS, and nanobus (20)

The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
Martijn Dashorst
 
Spring Mvc,Java, Spring
Spring Mvc,Java, SpringSpring Mvc,Java, Spring
Spring Mvc,Java, Spring
ifnu bima
 
WebAssemlby vs JavaScript
WebAssemlby vs JavaScriptWebAssemlby vs JavaScript
WebAssemlby vs JavaScript
Alexandr Skachkov
 
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
75waytechnologies
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
Johan Edstrom
 
Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021
Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021
Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021
Katy Slemon
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
Balajihope
 
Web Development Today
Web Development TodayWeb Development Today
Web Development Today
bretticus
 
Top 10 Backend Frameworks for Businesses in 2024
Top 10 Backend Frameworks for Businesses in 2024Top 10 Backend Frameworks for Businesses in 2024
Top 10 Backend Frameworks for Businesses in 2024
Sonika Jain
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
Jonathan Abrams
 
NodeJs Frameworks.pdf
NodeJs Frameworks.pdfNodeJs Frameworks.pdf
NodeJs Frameworks.pdf
WPWeb Infotech
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021
SWATHYSMOHAN
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
Michael Neale
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
rudib
 
The Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To Know
All Things Open
 
Top Node.js frameworks for web development in 2022.pdf
Top Node.js frameworks for web development in 2022.pdfTop Node.js frameworks for web development in 2022.pdf
Top Node.js frameworks for web development in 2022.pdf
Moon Technolabs Pvt. Ltd.
 
Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...
mfrancis
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
Rob Davarnia
 
Spring Mvc,Java, Spring
Spring Mvc,Java, SpringSpring Mvc,Java, Spring
Spring Mvc,Java, Spring
ifnu bima
 
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
75waytechnologies
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
Johan Edstrom
 
Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021
Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021
Top 10 Node.JS Frameworks To Gear Up Your Web App Development in 2021
Katy Slemon
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
Balajihope
 
Web Development Today
Web Development TodayWeb Development Today
Web Development Today
bretticus
 
Top 10 Backend Frameworks for Businesses in 2024
Top 10 Backend Frameworks for Businesses in 2024Top 10 Backend Frameworks for Businesses in 2024
Top 10 Backend Frameworks for Businesses in 2024
Sonika Jain
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
Jonathan Abrams
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
lubnayasminsebl
 
Latest Web development technologies 2021
 Latest Web development technologies 2021 Latest Web development technologies 2021
Latest Web development technologies 2021
SWATHYSMOHAN
 
Jaoo Michael Neale 09
Jaoo Michael Neale 09Jaoo Michael Neale 09
Jaoo Michael Neale 09
Michael Neale
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
rudib
 
The Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To KnowThe Ember.js Framework - Everything You Need To Know
The Ember.js Framework - Everything You Need To Know
All Things Open
 
Top Node.js frameworks for web development in 2022.pdf
Top Node.js frameworks for web development in 2022.pdfTop Node.js frameworks for web development in 2022.pdf
Top Node.js frameworks for web development in 2022.pdf
Moon Technolabs Pvt. Ltd.
 
Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...
mfrancis
 
Beginning MEAN Stack
Beginning MEAN StackBeginning MEAN Stack
Beginning MEAN Stack
Rob Davarnia
 

More from Jarrod Overson (20)

AppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is EvolvingAppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is Evolving
Jarrod Overson
 
How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019
Jarrod Overson
 
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
Jarrod Overson
 
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Jarrod Overson
 
Deepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the futureDeepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the future
Jarrod Overson
 
The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.
Jarrod Overson
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
Jarrod Overson
 
The life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleThe life of breached data and the attack lifecycle
The life of breached data and the attack lifecycle
Jarrod Overson
 
The Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of SecurityThe Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of Security
Jarrod Overson
 
Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16
Jarrod Overson
 
Graphics Programming for Web Developers
Graphics Programming for Web DevelopersGraphics Programming for Web Developers
Graphics Programming for Web Developers
Jarrod Overson
 
The Dark Side of Security
The Dark Side of SecurityThe Dark Side of Security
The Dark Side of Security
Jarrod Overson
 
JavaScript and the AST
JavaScript and the ASTJavaScript and the AST
JavaScript and the AST
Jarrod Overson
 
ES2015 workflows
ES2015 workflowsES2015 workflows
ES2015 workflows
Jarrod Overson
 
Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014 Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014
Jarrod Overson
 
Idiot proofing your code
Idiot proofing your codeIdiot proofing your code
Idiot proofing your code
Jarrod Overson
 
Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014
Jarrod Overson
 
Managing JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - FluentManaging JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - Fluent
Jarrod Overson
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web components
Jarrod Overson
 
Managing JavaScript Complexity
Managing JavaScript ComplexityManaging JavaScript Complexity
Managing JavaScript Complexity
Jarrod Overson
 
AppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is EvolvingAppSecCali - How Credential Stuffing is Evolving
AppSecCali - How Credential Stuffing is Evolving
Jarrod Overson
 
How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019How Credential Stuffing is Evolving - PasswordsCon 2019
How Credential Stuffing is Evolving - PasswordsCon 2019
Jarrod Overson
 
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
JSconf JP - Analysis of an exploited npm package. Event-stream's role in a su...
Jarrod Overson
 
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Analysis of an OSS supply chain attack - How did 8 millions developers downlo...
Jarrod Overson
 
Deepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the futureDeepfakes - How they work and what it means for the future
Deepfakes - How they work and what it means for the future
Jarrod Overson
 
The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.The State of Credential Stuffing and the Future of Account Takeovers.
The State of Credential Stuffing and the Future of Account Takeovers.
Jarrod Overson
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
Jarrod Overson
 
The life of breached data and the attack lifecycle
The life of breached data and the attack lifecycleThe life of breached data and the attack lifecycle
The life of breached data and the attack lifecycle
Jarrod Overson
 
The Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of SecurityThe Life of Breached Data & The Dark Side of Security
The Life of Breached Data & The Dark Side of Security
Jarrod Overson
 
Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16Shape Security @ WaffleJS October 16
Shape Security @ WaffleJS October 16
Jarrod Overson
 
Graphics Programming for Web Developers
Graphics Programming for Web DevelopersGraphics Programming for Web Developers
Graphics Programming for Web Developers
Jarrod Overson
 
The Dark Side of Security
The Dark Side of SecurityThe Dark Side of Security
The Dark Side of Security
Jarrod Overson
 
JavaScript and the AST
JavaScript and the ASTJavaScript and the AST
JavaScript and the AST
Jarrod Overson
 
Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014 Maintainability SFJS Sept 4 2014
Maintainability SFJS Sept 4 2014
Jarrod Overson
 
Idiot proofing your code
Idiot proofing your codeIdiot proofing your code
Idiot proofing your code
Jarrod Overson
 
Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014Riot on the web - Kenote @ QCon Sao Paulo 2014
Riot on the web - Kenote @ QCon Sao Paulo 2014
Jarrod Overson
 
Managing JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - FluentManaging JavaScript Complexity in Teams - Fluent
Managing JavaScript Complexity in Teams - Fluent
Jarrod Overson
 
Real World Web components
Real World Web componentsReal World Web components
Real World Web components
Jarrod Overson
 
Managing JavaScript Complexity
Managing JavaScript ComplexityManaging JavaScript Complexity
Managing JavaScript Complexity
Jarrod Overson
 
Ad

Recently uploaded (20)

Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Ad

Practical WebAssembly with Apex, wasmRS, and nanobus

  • 1. 1 Practical WebAssembly @jsoverson How To Get The Most Out Of Vanilla WASM
  • 2. Who here has used WebAssembly? @jsoverson
  • 3. Who here uses WebAssembly now? @jsoverson
  • 4. thinks the WebAssembly experience is straightforward and intuitive? @jsoverson Who here
  • 6. WebAssembly Isn't Easy @jsoverson For two reasons It Changes What Is Possible In Software 1 It unlocks potential we've never had before.
  • 7. 2 WebAssembly Isn't Easy @jsoverson For two reasons 1 It Changes What Is Possible In Software Everyone's Still Figuring Out 1 There are many questions, few answers, and myriad parallel solutions
  • 8. WebAssembly standardizes logic Containers standardized processes The Last Artifact @jsoverson WebAssembly is the fi nal step in standardizing distribution VMs standardized the OS & environment There is no next step. This is all software. VMs standardized the OS & environment
  • 9. • Author, Web Expert, & Lifelong Hacker • CTO Candle Jarrod Overson @jsoverson Posts about WebAssembly, Security, and JS/Rust topics here Looks like this
  • 10. 10 1 2 3 Understanding Fragmentation Bridging The Gap Building Something Real Agenda
  • 11. Flavors of WASM Vanilla WASM WASI WASI Proposals WASM Proposals Plain ol' WebAssembly that adheres to the MVP spec. Runs everywhere. Browser: Server: Baseline Extensions @jsoverson
  • 12. Flavors of WASM WASI WASI Proposals WASM Proposals WebAssembly that leverages early proposal implementations (e.g. threads). Support is variable. Browser: Server: Baseline Vanilla WASM + @jsoverson Extensions
  • 13. Flavors of WASM WASI WASI Proposals WASM Proposals WebAssembly that targets the WASI (WebAssembly Systems Interface) spec. Great support on server side. Not tailored to browsers. Browser: Server: Baseline Vanilla WASM + @jsoverson Extensions
  • 14. Flavors of WASM WASI WASI Proposals WASM Proposals WebAssembly that leverages early WASI proposal implementations (e.g. sockets). Support is universally poor. Browser: Server: Baseline Vanilla WASM + @jsoverson Extensions
  • 15. Flavors of WASM SDKs Platform-speci fi c SDKs that leverage speci fi c host features. Compatibility is tied to host compatibility. Browser: Server: - - Baseline Vanilla WASM + @jsoverson Honorable Mention WASI WASI Proposals WASM Proposals
  • 16. Just Because It's WebAssembly Doesn't Mean It's Portable @jsoverson
  • 17. Lessons From JavaScript The community tried to make a universal module format with JavaScript, but we had momentum working against us Mobile: Server: Other: JavaScript + DOM + WebView APIs JavaScript + Server (e.g. Node) APIs JavaScript + Random stuff Browser: JavaScript + DOM @jsoverson
  • 18. Lessons From JavaScript The community tried to make a universal module format with JavaScript, but we had momentum working against us Mobile: Server: Other: JavaScript + DOM + WebView APIs JavaScript + Server (e.g. Node) APIs JavaScript + Random stuff Browser: JavaScript + DOM We tried to write tools that would shim and transpile everything that wasn't core JS into core JS. It was an arms race. We never ful fi lled the vision.
  • 19. The Opportunity With WASM We have a baseline already. It's up to the community to preserve it. Mobile: Server: Other: WebAssembly WebAssembly + WASI WebAssembly Browser: WebAssembly WASI is great for entrypoints like CLI apps and servers, but it's not critical for most libraries. If our libraries accept WASM/WASI as a default we turn our nose up at 1 billion+ devices.
  • 20. 20 1 2 3 Understanding Fragmentation Bridging The Gap Building Something Real Agenda
  • 21. What we want @jsoverson Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible. 1 2 3 4 Rich data types Asynchronous operations Automatic linking Generated bindings
  • 22. 4 What we want @jsoverson Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible. 1 2 3 Rich data types Asynchronous operations Automatic linking Generated bindings Future: Component Model Now: Apex + wasmRS
  • 23. What we want @jsoverson Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible. 1 2 3 4 Rich data types Asynchronous operations Automatic linking Generated bindings Future: Threads, sort of and ...? Now: wasmRS
  • 24. What we want @jsoverson Building our basic needs into Vanilla WebAssembly is not trivial, but it's possible. 1 2 3 4 Rich data types Asynchronous operations Automatic linking Generated bindings Future: WIT & wit-bindgen Now: Apex
  • 25. WIT & Apex @jsoverson WIT Apex Both are IDLs. Both are interpreted by generators to generate code that would be cumbersome and error-prone to write by hand. WIT is a project tailored to the WebAssembly component model and fl uctuates as proposals fl uctuate. Apex is generic and use-case agnostic. It's a good parent IDL.
  • 26. Until the component model @jsoverson Apex can help generate bindings, boilerplate, and integration code for WebAssembly today. https://apexlang.io
  • 27. After the component model @jsoverson Apex can generate WIT and wit-bindgen can generate bindings WIT https://apexlang.io
  • 28. After the component model @jsoverson You can throwaway Apex or keep using it generate other artifacts. JSON Schema API impls Docs WIT https://apexlang.io
  • 29. Async Operations + Rich Data @jsoverson The wasmRS suite gives us reactive streams in and out of WebAssembly wasmRS WebAssembly wasmRS opens a socket into WebAssembly with bidirectional streams complete with backpressure and fragmentation. wasmRS will exist for a long time and will incorporate standards as they land. https://github.com/nanobus/iota
  • 30. Years of Production Experience @jsoverson wasmRS takes lessons learned from waPC and pushes ideas further Complex Data Errors Host/Guest calls Browser- compatible Reactive Streams Async Operations waPC wasmRS Both give developers a common way of interfacing with Vanilla WebAssembly. Both have support for multiple languages on the guest and the host side. waPC will continue to work while the future is wasmRS. https://github.com/nanobus/iota
  • 31. Automatic Linking @jsoverson Components built with Apex & wasmRS contain the data necessary to understand how they connect to others. and their exports Components declare their imports A runtime can connect them all, automatically
  • 32. Nanobus @jsoverson Nanobus connects disparate components into one running application. microservice iota low-code iota wasm iota wasm iota Components (we call them iotas) postgres redis etc External services Nanobus runtime https://github.com/nanobus/nanobus
  • 33. 2 33 1 3 Understanding Fragmentation Bridging The Gap Building Something Real Agenda
  • 34. 34 URL Shortener First, we fi gure out the interface we want to expose In this case, we need two methods... ...each take a string... ...and return a string shorten URL ID lookup ID URL
  • 35. 35 URL Shortener What it looks like de fi ned in Apex. Apex looks like code but it's just con fi guration.
  • 36. 36 Where Do We Store URLs? shorten URL ID ??? We could store them in a database, but then we tie ourselves to a storage implementation. It makes our component less reusable and DEV/QA/PROD testing more dif fi cult.
  • 37. 37 Where Do We Store URLs? shorten URL ID storeUrl(id, url) It's easier to ignore the implementation completely.
  • 38. 38 Where Do We Store URLs? We can de fi ne our interface and leave the implementation for later.
  • 39. 39 The Component Definition @service tags what we deliver (export), @provider tags what we need (import). Note: these are Apex directives. Directives extend Apex for project-speci fi c purposes like nanobus
  • 40. 40 Generating Everything Let the apex CLI or the VSCode plugin generate everything automatically.
  • 41. 41
  • 42. 42
  • 43. 43 This is the business logic. That's it.
  • 44. 44 In lookup() there is zero unique logic. We're just calling the storage provider. We don't need code for that. We can get rid of it. After compiling, we end up with a wasm binary from 1 line of business logic.
  • 45. Implementing Our URL Repository Provider But hold up... How much of the code you write to persist data or query databases is actually unique and valuable?
  • 46. 46 Components don't need to be WebAssembly Code that already exists. Our Repository component then becomes 100% con fi guration. We de fi ne our Repository component in terms of its namespace and interface name
  • 48. 48 We turned what amounts to a library with 1 line of business logic into a database-backed web service by reusing existing components and connecting them together
  • 49. WebAssembly Is Ready Now 1 The Investment Will Pay Off @jsoverson
  • 50. WebAssembly Is Ready Now 1 2 The Investment Will Pay Off Be Bold and Uncompromising @jsoverson
  • 51. WebAssembly Is Ready Now 1 2 3 The Investment Will Pay Off Be Bold and Uncompromising Software Is Changing, Be Ready For It.