Kotlin/Wasm:
Present and Future
Zalim Bashorov
@bashorov
Zalim Bashorov
@bashorov
Kotlin/Wasm:
Present and Future
PRESENT and future
Zalim Bashorov
@bashorov
Kotlin/Wasm:
Agenda
Agenda
WebAssembly
Agenda
WebAssembly
Kotlin/Wasm
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
WebAssembly (aka Wasm)
| … is a binary instruction format for a stack-based virtual machine.
WebAssembly (aka Wasm)
Key Advantages
WebAssembly (aka Wasm)
Key Advantages
Portability
WebAssembly (aka Wasm)
Key Advantages
Security
Portability
WebAssembly (aka Wasm)
Key Advantages
Security
Performance
Portability
WebAssembly (aka Wasm)
Key Advantages
Security
Performance
Lightweight
Binaries
Runtimes
Portability
WebAssembly (aka Wasm)
Key Advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
WebAssembly (aka Wasm)
Everywhere
WebAssembly (aka Wasm)
Everywhere
Web Applications
WebAssembly (aka Wasm)
Everywhere
Web Applications
Cloud & Edge computing
WebAssembly (aka Wasm)
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
WebAssembly (aka Wasm)
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
WebAssembly (aka Wasm)
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
WebAssembly (aka Wasm)
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
WebAssembly (aka Wasm)
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
WebAssembly (aka Wasm)
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
+
+
=
New Compiler
New Compiler
Fast Compilation
Incremental Compilation*
New Compiler
Fast Compilation
Incremental Compilation*
Great integration with hosts
New Compiler
Fast Compilation
Incremental Compilation*
Great integration with hosts
Good Interop with hosts
import kotlinx.browser.document
fun main() {
val p = document.createElement("p")
p.innerHTML = "Hello World!"
document.body?.appendChild(p)
}
New Compiler
Fast Compilation
Incremental Compilation*
Great integration with hosts
Good Interop with hosts
import kotlinx.browser.document
fun main() {
val p = document.createElement("p")
p.innerHTML = "Hello World!"
document.body?.appendChild(p)
}
Small binaries
New Compiler
4K
Fast Compilation
Incremental Compilation*
Great integration with hosts
Good Interop with hosts
import kotlinx.browser.document
fun main() {
val p = document.createElement("p")
p.innerHTML = "Hello World!"
document.body?.appendChild(p)
}
Small binaries
Targets
Targets
wasm-js
Targets
wasm-js
wasm-wasi
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
Runtime Requirements
Wasm VMs must support next proposals:
Runtime Requirements
Wasm VMs must support next proposals:
Garbage Collection (GC)
Runtime Requirements
Wasm VMs must support next proposals:
Garbage Collection (GC)
Exception Handling*
Inside Browsers
Works out of the box in major browsers
Inside Browsers
Works out of the box in major browsers
V
Inside Browsers
Works out of the box in major browsers
V
V
Inside Browsers
Works out of the box in major browsers
V
V
Inside Browsers
Works out of the box in major browsers
V
V
V*
Inside Browsers
Works out of the box in major browsers
V
V
V*
Inside Browsers
Works out of the box in major browsers
V
V
V*
soon
Outside of Browsers
Outside of Browsers
V
V
V
V
V
Node.js
Deno
Workerd (Cloudflare Workers)
WasmEdge (0.14+)
WAMR 2.0+
Outside of Browsers
V
V
V
V
V
Node.js
Deno
Workerd (Cloudflare Workers)
WasmEdge (0.14+)
WAMR 2.0+
Wasmtime
Wasmer
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
Use Cases
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Use Cases
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Use Cases
Everywhere
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Use Cases
Everywhere
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Web Applications
Compose Multiplatform
Compose Multiplatform
Why Kotlin/Wasm?
Compose for Web is Alpha
Alpha
Why Web?
Why Web? Web is a Good Platform
Why Web? Web is a Good Platform
Open platform
Why Web? Web is a Good Platform
Open platform
Browsers are everywhere
Mostly up-to-date
Why Web? Web is a Good Platform
Open platform
Browsers are everywhere
Mostly up-to-date
App Distribution
Easy
Under your control
Always up-to-date
Why Web? Web is a Good Platform
Open platform
Browsers are everywhere
Mostly up-to-date
App Distribution
Easy
Under your control
Always up-to-date
App Running
Easy
No need to install
You can install, if you want
Why Web? Web is a Good Platform
Open platform
Browsers are everywhere
Mostly up-to-date
App Distribution
Easy
Under your control
Always up-to-date
App Running
Easy
No need to install
You can install, if you want
Near-Native performance with WebAssembly
Offline mode
Standalone App
1
2
Diff
Diff
Diff
Try it!
Adding Web to Compose App
Examples
Adding Web to Compose App
Examples
Adding Web to Compose App
Examples
It’s you turn…
#compose-web k s
Outside of Browsers
Cloud & Edge computing and more …
Why?
Outside of Browsers
Cloud & Edge computing and more …
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
Key advantages
Security
Performance
Lightweight
Binaries
Interoperability
Runtimes
Portability
Web Applications
Cloud & Edge computing
Plugins & Extensions
Embedded
Blockchain
Mobile
Desktop
WASI
WebAssembly System Interface
– group of standard API specifications for Wasm
WASI target
WASI target
Based on WASI Preview 1 (K 1.9.20+)
V
WASI target
Based on WASI Preview 1 (K 1.9.20+)
V
WASI 0.2 (aka Preview 2)
Component Model
WASI: DEMO time!
Using wasi-example from https://kotl.in/wasm-examples
inside Cloudflare Workers
Agenda
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
Tooling
Tooling
IDEs
Tooling
IDEs
Debugger
Tooling
IDEs
Debugger
Build Tools
Tooling in Action
Explore
Edit
Debug
Takeaways
WebAssembly
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
Takeaways
Kotlin/Wasm
State of Wasm Runtimes
Use cases
State of Tooling
WebAssembly is Cool!
Takeaways
State of Wasm Runtimes
Use cases
State of Tooling
WebAssembly is Cool!
Kotlin is Awesome!
Takeaways
Use cases
State of Tooling
WebAssembly is Cool!
Kotlin is Awesome!
Compose for Web is Future of Web Apps!
Takeaways
State of Tooling
WebAssembly is Cool!
Kotlin is Awesome!
Compose for Web is Future of Web Apps!
Outside of Browser usage is Promising!
Takeaways
WebAssembly is Cool!
Kotlin is Awesome!
Compose for Web is Future of Web Apps!
Outside of Browser usage is Promising!
Tooling is Good!
Thank you, and
don’t forget to vote
@bashorov