~/talk

The GHC WebAssembly Backend

Talkat 2023 GHC Contributors' Workshop · 2023-06-07..06-09· [haskell, webassembly]
slides:none on file

GHC now ships a WebAssembly backend (Asterius → in-tree) that actually builds with ghc.nix with withWasiSDK=true, produces ~10–12 MB .wasm executables (example: a GHC-API pretty-printer and in-browser Ormolu), and runs under Wasmtime. Key engineering details: emit linkable wasm objects (linking convention / textual assembly), lower Cmm with a Relooper, fix the RTS megablock allocator by growing linear memory via osdump.c, and test via Hadrian plus a cross emulator; wasm-opt shrinks 40–50%.

AI-written summary · about

  1. 0:00GHC WASM backend intro
  2. 4:28Building GHC WASM from source
  3. 7:07WebAssembly basics for GHC
  4. 29:01WebAssembly control flow
  5. 48:56Why Asterius failed
  6. 1:00:01Why WASM beats bytecode
  7. 1:02:52GHC WASM backend overview
  8. 1:05:49Porting GHC RTS storage
  9. 1:16:43RTS tweaks for WASM
  10. 1:23:23Lowering Cmm to WASM
  11. 1:39:08WASM code generation
  12. 1:43:53Testing GHC WASM backend
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.