SlideShare a Scribd company logo
A world to win
WebAssembly for the rest of us
17 Mar 2023 – BOB 2023
Andy Wingo
Igalia, S.L.
WebAssembly,
the story
WebAssembly is an exciting new
universal compute platform
WebAssembly,
the pitch
Predictable portable performance
Low-level
❧
Within 10% of native
❧
Reliable composition via isolation
Modules share nothing by default
❧
No nasal demons
❧
Memory sandboxing
❧
Compile your code to WebAssembly
for easier distribution and composition
WebAssembly,
the hype
It’s in all browsers! Serve your code to
anyone in the world!
It’s on the edge! Run code from your
web site close to your users!
Compose a library (eg: Expat) into
your program (eg: Firefox), without
risk!
It’s the new lightweight virtualization:
Wasm is what containers were to VMs!
Give me that Kubernetes cash!!!
WebAssembly,
the reality
WebAssembly is a weird backend for a
C compiler
Only some source languages are having
success on WebAssembly
What about Haskell, Ocaml, Scheme,
F#, and so on – what about us?
Are we just lazy? (Well...)
WebAssembly,
the reality
(2)
WebAssembly (1.0, 2.0) is not well-
suited to garbage-collected languages
Let’s look into why
GC and
WebAssembly
1.0
Where do garbage-collected values
live?
For WebAssembly 1.0, only possible
answer: linear memory
(module
(global $hp (mut i32) (i32.const 0))
(memory $mem 10)) ;; 640 kB
(func $alloc (param $size i32) (result i32)
(local $ret i32)
(loop $retry
(local.set $ret (global.get $hp))
(global.set $hp
(i32.add (local.get $size) (local.get $ret)))
(br_if 1
(i32.lt_u (i32.shr_u (global.get $hp) 16)
(memory.size))
(local.get $ret))
(call $gc)
(br $retry)))
GC and
WebAssembly
1.0 (2)
What hides behind (call $gc) ?
Ship a GC over linear memory
Stop-the-world, not parallel, not
concurrent
But... roots.
GC and
WebAssembly
1.0 (3)
Live objects are
the roots
❧
any object referenced by a live
object
❧
Roots are globals and locals in active
stack frames
No way to visit active stack
frames
GC and
WebAssembly
1.0 (3)
Workarounds
handle stack for precise roots
❧
spill all possibly-pointer values to
linear memory and collect
conservatively
❧
Handle book-keeping a drag for
compiled code
GC and
WebAssembly
1.0 (4)
Cycles with external objects (e.g.
JavaScript) uncollectable
A pointer to a GC-managed object is an
offset to linear memory, need
capability over linear memory to read/
write object from outside world
No way to give back memory to the OS
Gut check: gut says no
GC and
WebAssembly
1.0 (5)
There is already a high-performance
concurrent parallel compacting GC in
the browser
Halftime: C++ 1 – Altlangs 0
Change is
coming!
Support for built-in GC set to ship in
Q4 2023
With GC, the material conditions are
now in place
Let’s compile our languages to
WebAssembly
Scheme to
Wasm
Spritely + Igalia working on Scheme to
WebAssembly
Avoid truncating language to platform;
bring whole self
Value representation
❧
Varargs
❧
Tail calls
❧
Delimited continuations
❧
Numeric tower
❧
Scheme to
Wasm:
Values
;; any extern func
;; |
;; eq
;; / | 
;; i31 struct array
The unitype: (ref eq)
Immediate values in (ref i31)
fixnums with 30-bit range
❧
chars, bools, etc
❧
Explicit nullability: (ref null eq) vs
(ref eq)
Scheme to
Wasm:
Values (2)
Heap objects subtypes of struct;
concretely:
(struct $heap-object
(struct (field $tag-and-hash i32)))
(struct $pair
(sub $heap-object
(struct i32 (ref eq) (ref eq))))
GC proposal allows subtyping on
structs, functions, arrays
Structural type equivalance: explicit
tag useful
Scheme to
Wasm:
Values (3)
(func $cons (param (ref eq)
(ref eq))
(result (ref $pair))
(struct.new_canon $pair
;; Assume heap tag for pairs is 1.
(i32.const 1)
;; Car and cdr.
(local.get 0)
(local.get 1)))
(func $%car (param (ref $pair))
(result (ref eq))
(struct.get $pair 1 (local.get 0)))
(func $car (param (ref eq)) (result (ref eq))
(local (ref $pair))
(block $not-pair
(br_if $not-pair
(i32.eqz (ref.test $pair (local.get 0))))
(local.set 1 (ref.cast $pair) (local.get 0))
(br_if $not-pair
(i32.ne
(i32.const 1)
(i32.and
(i32.const 0xff)
(struct.get $heap-object 0 (local.get 1)))))
(return_call $%car (local.get 1)))
(call $type-error)
(unreachable))
Scheme to
Wasm
Value representation
❧
Varargs
❧
Tail calls
❧
Delimited continuations
❧
Numeric tower
❧
Scheme to
Wasm:
Varargs
(list 'hey) ;; => (hey)
(list 'hey 'bob) ;; => (hey bob)
Problem: Wasm functions strongly
typed
(func $list (param ???) (result (ref eq))
???)
Solution: Virtualize calling convention
;; "Registers" for args 0 to 3
(global $arg0 (mut (ref eq)) (i31.new (i32.const 0)))
(global $arg1 (mut (ref eq)) (i31.new (i32.const 0)))
(global $arg2 (mut (ref eq)) (i31.new (i32.const 0)))
(global $arg3 (mut (ref eq)) (i31.new (i32.const 0)))
;; "Memory" for the rest
(type $argv (array (ref eq)))
(global $argN (ref $argv)
(array.new_canon_default
$argv (i31.const 42) (i31.new (i32.const 0))))
Uniform function type: argument count as sole parameter
Callee moves args to locals, possibly clearing roots
Scheme to
Wasm
Value representation
❧
Varargs
❧
Tail calls
❧
Delimited continuations
❧
Numeric tower
❧
Scheme to
Wasm: Tail
calls
;; Call known function
(return_call $f arg ...)
;; Call function by value
(return_call_ref $type callee arg ...)
Scheme to
Wasm
Value representation
❧
Varargs
❧
Tail calls
❧
Delimited continuations
❧
Numeric tower
❧
Scheme to
Wasm:
Prompts (1)
Problem: Lightweight threads/fibers,
exceptions
Possible solutions
Eventually, built-in coroutines
❧
https://github.com/
WebAssembly/binaryen’s asyncify
(not yet ready for GC); see Julia
❧
Delimited continuations
❧
“Bring your whole self”
Scheme to
Wasm:
Prompts (2)
Prompts delimit continuations
(define k
(call-with-prompt 'foo
; body
(lambda ()
(+ 34 (abort-to-prompt 'foo)))
; handler
(lambda (continuation)
continuation)))
(k 10) ;; ⇒ 44
(- (k 10) 2) ;; ⇒ 42
k is the _ in (lambda () (+ 34 _))
Scheme to
Wasm:
Prompts (3)
Delimited continuations are stack
slices
Make stack explicit via minimal
continuation-passing-style conversion
Turn all calls into tail calls
❧
Allocate return continuations on
explicit stack
❧
Breaks functions into pieces at non-
tail calls
❧
Scheme to
Wasm:
Prompts (4)
Before a non-tail-call:
Push live-out vars on stacks (one
stack per top type)
❧
Push continuation as funcref
❧
Tail-call callee
❧
Return from call via pop and tail call:
(return_call_ref (call $pop-return)
(i32.const 0))
After return, continuation pops state
from stacks
Scheme to
Wasm:
Prompts (5)
abort-to-prompt:
Pop stack slice to reified
continuation object
❧
Tail-call new top of stack: prompt
handler
❧
Calling a reified continuation:
Push stack slice
❧
Tail-call new top of stack
❧
No need to wait for effect handlers
proposal; you can have it all now!
Scheme to
Wasm
Value representation
❧
Varargs
❧
Tail calls
❧
Delimited continuations
❧
Numeric tower
❧
Scheme to
Wasm:
Numbers
Numbers can be immediate: fixnums
Or on the heap: bignums, fractions,
flonums, complex
Supertype is still ref eq
Consider imports to implement
bignums
On web: BigInt
❧
On edge: Wasm support module
(mini-gmp?)
❧
Dynamic dispatch for polymorphic
ops, as usual
Scheme to
Wasm
Value representation
❧
Varargs
❧
Tail calls
❧
Delimited continuations
❧
Numeric tower
❧
Miscellenea Debugging: The wild west of DWARF;
prompts
Strings: stringref host strings spark
joy
JS interop: Export accessors; Wasm
objects opaque to JS. externref.
JIT: A whole ’nother talk! https://
wingolog.org/archives/2022/08/18/
just-in-time-code-generation-
within-webassembly
AOT: wasm2c
WebAssembly
for the rest
of us
With GC, WebAssembly is now ready
for us
Getting our languages on
WebAssembly now a S.M.O.P.
Let’s score some goals in the second
half!
(visit-links
"gitlab.com/spritely/guile-hoot-updates"
"wingolog.org"
"wingo@igalia.com"
"igalia.com"
"mastodon.social/@wingo")

More Related Content

PDF
Scheme on WebAssembly: It is happening!
PDF
WASM Garbage Collection in JSC
PPTX
WebAssembly: In a Nutshell
PDF
What's wrong with web
PDF
WebAssembly. Neither Web Nor Assembly, All Revolutionary
PDF
Compiling To Web Assembly
PDF
WebAssembly for the rest of us - Jan-Erik Rediger - Codemotion Amsterdam 2017
PDF
Build Your Own WebAssembly Compiler
Scheme on WebAssembly: It is happening!
WASM Garbage Collection in JSC
WebAssembly: In a Nutshell
What's wrong with web
WebAssembly. Neither Web Nor Assembly, All Revolutionary
Compiling To Web Assembly
WebAssembly for the rest of us - Jan-Erik Rediger - Codemotion Amsterdam 2017
Build Your Own WebAssembly Compiler

Similar to A world to win: WebAssembly for the rest of us (20)

PDF
Web (dis)assembly
PDF
Web Assembly
PDF
Clang, Clang: Who's there? WebAssembly!
PDF
Boyan Mihaylov - Is web assembly the killer of javascript
PDF
Is WebAssembly the killer of JavaScript?
PDF
Fast, deterministic, and verifiable computations with WebAssembly
PDF
WebAssembly: Digging a bit deeper
PDF
DEF CON 27- JACK BAKER - web assembly games
PDF
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
PPT
Web assembly overview by Mikhail Sorokovsky
PDF
Web assembly brings the web to a new era
PDF
The Ring programming language version 1.4 book - Part 21 of 30
PDF
Scylla Summit 2022: ScyllaDB Embraces Wasm
PDF
Appsec obfuscator reloaded
PDF
Keeping Latency Low for User-Defined Functions with WebAssembly
PDF
The Rust Programming Language
PDF
Fast, deterministic, and verifiable computations with WebAssembly. WASM on th...
PPTX
Intel JIT Talk
PDF
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
PDF
Javascript engine performance
Web (dis)assembly
Web Assembly
Clang, Clang: Who's there? WebAssembly!
Boyan Mihaylov - Is web assembly the killer of javascript
Is WebAssembly the killer of JavaScript?
Fast, deterministic, and verifiable computations with WebAssembly
WebAssembly: Digging a bit deeper
DEF CON 27- JACK BAKER - web assembly games
Apidays Paris 2023 - Forget TypeScript, Choose Rust to build Robust, Fast and...
Web assembly overview by Mikhail Sorokovsky
Web assembly brings the web to a new era
The Ring programming language version 1.4 book - Part 21 of 30
Scylla Summit 2022: ScyllaDB Embraces Wasm
Appsec obfuscator reloaded
Keeping Latency Low for User-Defined Functions with WebAssembly
The Rust Programming Language
Fast, deterministic, and verifiable computations with WebAssembly. WASM on th...
Intel JIT Talk
Stranger in These Parts. A Hired Gun in the JS Corral (JSConf US 2012)
Javascript engine performance
Ad

More from Igalia (20)

PDF
Life of a Kernel Bug Fix
PDF
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
PDF
Advancing WebDriver BiDi support in WebKit
PDF
Jumping Over the Garden Wall - WPE WebKit on Android
PDF
Collective Funding, Governance and Prioritiation of Browser Engine Projects
PDF
Don't let your motivation go, save time with kworkflow
PDF
Solving the world’s (localization) problems
PDF
The Whippet Embeddable Garbage Collection Library
PDF
Nobody asks "How is JavaScript?"
PDF
Getting more juice out from your Raspberry Pi GPU
PDF
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
PDF
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
PDF
CSS :has() Unlimited Power
PDF
Device-Generated Commands in Vulkan
PDF
Current state of Lavapipe: Mesa's software renderer for Vulkan
PDF
Vulkan Video is Open: Application showcase
PDF
EBC - A new backend compiler for etnaviv
PDF
RISC-V LLVM State of the Union
PDF
Device-Generated Commands in Vulkan
PDF
Downstream challenges
Life of a Kernel Bug Fix
Unlocking the Full Potential of WPE to Build a Successful Embedded Product
Advancing WebDriver BiDi support in WebKit
Jumping Over the Garden Wall - WPE WebKit on Android
Collective Funding, Governance and Prioritiation of Browser Engine Projects
Don't let your motivation go, save time with kworkflow
Solving the world’s (localization) problems
The Whippet Embeddable Garbage Collection Library
Nobody asks "How is JavaScript?"
Getting more juice out from your Raspberry Pi GPU
WebRTC support in WebKitGTK and WPEWebKit with GStreamer: Status update
Demystifying Temporal: A Deep Dive into JavaScript New Temporal API
CSS :has() Unlimited Power
Device-Generated Commands in Vulkan
Current state of Lavapipe: Mesa's software renderer for Vulkan
Vulkan Video is Open: Application showcase
EBC - A new backend compiler for etnaviv
RISC-V LLVM State of the Union
Device-Generated Commands in Vulkan
Downstream challenges
Ad

Recently uploaded (20)

PDF
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
PDF
Alethe Consulting Corporate Profile and Solution Aproach
PDF
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
PPTX
Layers_of_the_Earth_Grade7.pptx class by
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPT
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
PPTX
Internet Safety for Seniors presentation
PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
PDF
Containerization lab dddddddddddddddmanual.pdf
PPT
Ethics in Information System - Management Information System
PDF
Slides PDF: The World Game (s) Eco Economic Epochs.pdf
PPTX
Slides PPTX: World Game (s): Eco Economic Epochs.pptx
PDF
The Evolution of Traditional to New Media .pdf
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PDF
Exploring The Internet Of Things(IOT).ppt
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
Alethe Consulting Corporate Profile and Solution Aproach
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
Layers_of_the_Earth_Grade7.pptx class by
Mathew Digital SEO Checklist Guidlines 2025
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
Internet Safety for Seniors presentation
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
Containerization lab dddddddddddddddmanual.pdf
Ethics in Information System - Management Information System
Slides PDF: The World Game (s) Eco Economic Epochs.pdf
Slides PPTX: World Game (s): Eco Economic Epochs.pptx
The Evolution of Traditional to New Media .pdf
artificialintelligenceai1-copy-210604123353.pptx
Exploring The Internet Of Things(IOT).ppt
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)

A world to win: WebAssembly for the rest of us

  • 1. A world to win WebAssembly for the rest of us 17 Mar 2023 – BOB 2023 Andy Wingo Igalia, S.L.
  • 2. WebAssembly, the story WebAssembly is an exciting new universal compute platform
  • 3. WebAssembly, the pitch Predictable portable performance Low-level ❧ Within 10% of native ❧ Reliable composition via isolation Modules share nothing by default ❧ No nasal demons ❧ Memory sandboxing ❧ Compile your code to WebAssembly for easier distribution and composition
  • 4. WebAssembly, the hype It’s in all browsers! Serve your code to anyone in the world! It’s on the edge! Run code from your web site close to your users! Compose a library (eg: Expat) into your program (eg: Firefox), without risk! It’s the new lightweight virtualization: Wasm is what containers were to VMs! Give me that Kubernetes cash!!!
  • 5. WebAssembly, the reality WebAssembly is a weird backend for a C compiler Only some source languages are having success on WebAssembly What about Haskell, Ocaml, Scheme, F#, and so on – what about us? Are we just lazy? (Well...)
  • 6. WebAssembly, the reality (2) WebAssembly (1.0, 2.0) is not well- suited to garbage-collected languages Let’s look into why
  • 7. GC and WebAssembly 1.0 Where do garbage-collected values live? For WebAssembly 1.0, only possible answer: linear memory (module (global $hp (mut i32) (i32.const 0)) (memory $mem 10)) ;; 640 kB
  • 8. (func $alloc (param $size i32) (result i32) (local $ret i32) (loop $retry (local.set $ret (global.get $hp)) (global.set $hp (i32.add (local.get $size) (local.get $ret))) (br_if 1 (i32.lt_u (i32.shr_u (global.get $hp) 16) (memory.size)) (local.get $ret)) (call $gc) (br $retry)))
  • 9. GC and WebAssembly 1.0 (2) What hides behind (call $gc) ? Ship a GC over linear memory Stop-the-world, not parallel, not concurrent But... roots.
  • 10. GC and WebAssembly 1.0 (3) Live objects are the roots ❧ any object referenced by a live object ❧ Roots are globals and locals in active stack frames No way to visit active stack frames
  • 11. GC and WebAssembly 1.0 (3) Workarounds handle stack for precise roots ❧ spill all possibly-pointer values to linear memory and collect conservatively ❧ Handle book-keeping a drag for compiled code
  • 12. GC and WebAssembly 1.0 (4) Cycles with external objects (e.g. JavaScript) uncollectable A pointer to a GC-managed object is an offset to linear memory, need capability over linear memory to read/ write object from outside world No way to give back memory to the OS Gut check: gut says no
  • 13. GC and WebAssembly 1.0 (5) There is already a high-performance concurrent parallel compacting GC in the browser Halftime: C++ 1 – Altlangs 0
  • 14. Change is coming! Support for built-in GC set to ship in Q4 2023 With GC, the material conditions are now in place Let’s compile our languages to WebAssembly
  • 15. Scheme to Wasm Spritely + Igalia working on Scheme to WebAssembly Avoid truncating language to platform; bring whole self Value representation ❧ Varargs ❧ Tail calls ❧ Delimited continuations ❧ Numeric tower ❧
  • 16. Scheme to Wasm: Values ;; any extern func ;; | ;; eq ;; / | ;; i31 struct array The unitype: (ref eq) Immediate values in (ref i31) fixnums with 30-bit range ❧ chars, bools, etc ❧ Explicit nullability: (ref null eq) vs (ref eq)
  • 17. Scheme to Wasm: Values (2) Heap objects subtypes of struct; concretely: (struct $heap-object (struct (field $tag-and-hash i32))) (struct $pair (sub $heap-object (struct i32 (ref eq) (ref eq)))) GC proposal allows subtyping on structs, functions, arrays Structural type equivalance: explicit tag useful
  • 18. Scheme to Wasm: Values (3) (func $cons (param (ref eq) (ref eq)) (result (ref $pair)) (struct.new_canon $pair ;; Assume heap tag for pairs is 1. (i32.const 1) ;; Car and cdr. (local.get 0) (local.get 1))) (func $%car (param (ref $pair)) (result (ref eq)) (struct.get $pair 1 (local.get 0)))
  • 19. (func $car (param (ref eq)) (result (ref eq)) (local (ref $pair)) (block $not-pair (br_if $not-pair (i32.eqz (ref.test $pair (local.get 0)))) (local.set 1 (ref.cast $pair) (local.get 0)) (br_if $not-pair (i32.ne (i32.const 1) (i32.and (i32.const 0xff) (struct.get $heap-object 0 (local.get 1))))) (return_call $%car (local.get 1))) (call $type-error) (unreachable))
  • 20. Scheme to Wasm Value representation ❧ Varargs ❧ Tail calls ❧ Delimited continuations ❧ Numeric tower ❧
  • 21. Scheme to Wasm: Varargs (list 'hey) ;; => (hey) (list 'hey 'bob) ;; => (hey bob) Problem: Wasm functions strongly typed (func $list (param ???) (result (ref eq)) ???) Solution: Virtualize calling convention
  • 22. ;; "Registers" for args 0 to 3 (global $arg0 (mut (ref eq)) (i31.new (i32.const 0))) (global $arg1 (mut (ref eq)) (i31.new (i32.const 0))) (global $arg2 (mut (ref eq)) (i31.new (i32.const 0))) (global $arg3 (mut (ref eq)) (i31.new (i32.const 0))) ;; "Memory" for the rest (type $argv (array (ref eq))) (global $argN (ref $argv) (array.new_canon_default $argv (i31.const 42) (i31.new (i32.const 0)))) Uniform function type: argument count as sole parameter Callee moves args to locals, possibly clearing roots
  • 23. Scheme to Wasm Value representation ❧ Varargs ❧ Tail calls ❧ Delimited continuations ❧ Numeric tower ❧
  • 24. Scheme to Wasm: Tail calls ;; Call known function (return_call $f arg ...) ;; Call function by value (return_call_ref $type callee arg ...)
  • 25. Scheme to Wasm Value representation ❧ Varargs ❧ Tail calls ❧ Delimited continuations ❧ Numeric tower ❧
  • 26. Scheme to Wasm: Prompts (1) Problem: Lightweight threads/fibers, exceptions Possible solutions Eventually, built-in coroutines ❧ https://github.com/ WebAssembly/binaryen’s asyncify (not yet ready for GC); see Julia ❧ Delimited continuations ❧ “Bring your whole self”
  • 27. Scheme to Wasm: Prompts (2) Prompts delimit continuations (define k (call-with-prompt 'foo ; body (lambda () (+ 34 (abort-to-prompt 'foo))) ; handler (lambda (continuation) continuation))) (k 10) ;; ⇒ 44 (- (k 10) 2) ;; ⇒ 42 k is the _ in (lambda () (+ 34 _))
  • 28. Scheme to Wasm: Prompts (3) Delimited continuations are stack slices Make stack explicit via minimal continuation-passing-style conversion Turn all calls into tail calls ❧ Allocate return continuations on explicit stack ❧ Breaks functions into pieces at non- tail calls ❧
  • 29. Scheme to Wasm: Prompts (4) Before a non-tail-call: Push live-out vars on stacks (one stack per top type) ❧ Push continuation as funcref ❧ Tail-call callee ❧ Return from call via pop and tail call: (return_call_ref (call $pop-return) (i32.const 0)) After return, continuation pops state from stacks
  • 30. Scheme to Wasm: Prompts (5) abort-to-prompt: Pop stack slice to reified continuation object ❧ Tail-call new top of stack: prompt handler ❧ Calling a reified continuation: Push stack slice ❧ Tail-call new top of stack ❧ No need to wait for effect handlers proposal; you can have it all now!
  • 31. Scheme to Wasm Value representation ❧ Varargs ❧ Tail calls ❧ Delimited continuations ❧ Numeric tower ❧
  • 32. Scheme to Wasm: Numbers Numbers can be immediate: fixnums Or on the heap: bignums, fractions, flonums, complex Supertype is still ref eq Consider imports to implement bignums On web: BigInt ❧ On edge: Wasm support module (mini-gmp?) ❧ Dynamic dispatch for polymorphic ops, as usual
  • 33. Scheme to Wasm Value representation ❧ Varargs ❧ Tail calls ❧ Delimited continuations ❧ Numeric tower ❧
  • 34. Miscellenea Debugging: The wild west of DWARF; prompts Strings: stringref host strings spark joy JS interop: Export accessors; Wasm objects opaque to JS. externref. JIT: A whole ’nother talk! https:// wingolog.org/archives/2022/08/18/ just-in-time-code-generation- within-webassembly AOT: wasm2c
  • 35. WebAssembly for the rest of us With GC, WebAssembly is now ready for us Getting our languages on WebAssembly now a S.M.O.P. Let’s score some goals in the second half! (visit-links "gitlab.com/spritely/guile-hoot-updates" "wingolog.org" "wingo@igalia.com" "igalia.com" "mastodon.social/@wingo")