ELLIOTTCABLE,

I haven't been live-tooting , mostly because I'm already live-{Discord,Slack,Notion,Telegram,Signal}'ing, and I can only multi-task so much while also trying to understand the talks …

but holy shit the Wasm talk by Andreas Rossberg1 was SO COOL

ELLIOTTCABLE,

I'm about 10,000% more interested in Wasm now.

ELLIOTTCABLE,

i had no idea what an interesting project, PL-wise, Wasm was; and I had no idea how -y the whole thing has ended up being? like, it's an abstract stack machine and VM specification … but now it has functors(!!) and effects(!?)

when it's up on YouTube, definitely go watch it — I'll try to remember to come back and add a link to this thread …

https://icfp23.sigplan.org/details/icfp-2023-icfp-keynotes/38/As-low-level-as-possible-but-no-lower

ELLIOTTCABLE,

gonna dump some slides, just the ones I happened to screenshot and take notes on:

ELLIOTTCABLE,
  • Wasm: a “low level virtual machine”
  • abstracting 'up' from the hardware, instead of abstracting 'down' from some particular language (like previous efforts — JVM, CIL)
  • stack machine; implicit arguments; S-expressions; labels, branches to labels, functions with explicitly-typed arguments; and on top, everything comes in modules with explicit imports and exports
ELLIOTTCABLE,

quote: the name “” is a historical accident; essentially ‘a way to sell to management that this is something we should be working on’ 🤣

ELLIOTTCABLE,

there was some time spent, that, uh, frankly borderline offended me, that i'm not gonna get into the details — but hey, they're very proud that the mathematical specification is "only two pages" (and very annoyed that they have to stoop so low as to provide a prose specification that is, god forbid, "two hundred" …)

ELLIOTTCABLE,

some more slides on their '2 pages math, 200 pages prose' problem(ish), cool, but skipping over … not text-annotating these, feel like death, mildly don't care …

image/png
image/png

ELLIOTTCABLE,

advertising an ‘explicit cost model’ — really important, maps well to things i understand about real-world industrial usage … (a huge upside of OCaml in production)

also quote: "the JIT can be pretty straightforward and dumb — can be very simple"

ELLIOTTCABLE,

he talked about the optimization problem of balancing perf, generality (across both languages above, and architectures below), and simplicity; with the caveat that none of those could ever move away from the requirement of safety-and-portability

ELLIOTTCABLE,

he talked about how one of the primary goals/constraints/jobs of the Wasm project is to keep the abstraction-level as low as possible (hence the title of the talk) — while still raising that abstraction-level when it's absolutely necessary, to provide the proper generality over architectures

examples he touched on:

  • number of registers is unknown, can't let the producer/compiler control that, have to depend on the VM/JIT
  • same for explicit function-addresses; not all architectures share data/code space, not all have function-pointers; have to have function-tables in Wasm instead
ELLIOTTCABLE,

one higher-level thing (of many in the talk) that seems-to-violate-this-but-we-did-it-for-good-reasons is exceptions

(reasoning for it being higher-level: type-safety; and safety/concealment across module-boundaries)

ELLIOTTCABLE,

so, talk moved on to big new things coming in 3.0 — and this stuff was super-exciting, and over and over has amazing parallels to ???

first: garbage collection? in a low-level VM???

reasoning: “GC is kinda the worst-case situation, for working on top of an abstraction-layer like WebAssembly”

ELLIOTTCABLE,

(another great quote: “the producer still needs to do the work of lowering their Rube-Goldberg-machine of a GC model down to this very simple model of memory-layout” 😅)

ELLIOTTCABLE,

finally, and i didn't take a lot of screenshots here, because i was too gapey-mouthed :P — but WasmFX.

effects. in Wasm. holy crap.

(there were lots of PL-ey jokes of ‘they wanted stack swapping … which us PL'ers know, they really mean continuations … which us PL'ers know, they really-really-mean effect handlers …’)

ELLIOTTCABLE,

he went into some detail about the challenges of implementing effectively-algebraic-effects in a low-level fashion, which has kinda never been done before, and breaks a lot of assumptions in the literature

ELLIOTTCABLE,

(i said 'finally' i lied i am sick leave me alone okay ugh)

actually-finally, he touched on the module system, the missing pieces there, what all has been missing … and how after working hard to add and reconcile all the missing pieces to the existing modularization, they basically ended up with -style functors … and then realized that … and then just decided to add to . 😱

(i had to duck out, so, again, no screenshots. cool as fuck, though.)

ELLIOTTCABLE,

anyway, the last bit from my notes, is a bit more personal:

I’ve always been harping, for years, on how and VMs are just such a surprisingly-fantastic, low-impedance match (see the whole , , , category — they're fantastic to use in practice); …

but now i’m learning that Wasm is … basically OCaml’s semantics, EVEN MORE DIRECTLY, in a bunch of cases, lmao.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • kavyap
  • InstantRegret
  • khanakhh
  • ngwrru68w68
  • osvaldo12
  • DreamBathrooms
  • mdbf
  • magazineikmin
  • thenastyranch
  • everett
  • Youngstown
  • slotface
  • rosin
  • GTA5RPClips
  • JUstTest
  • Durango
  • cubers
  • modclub
  • tester
  • tacticalgear
  • cisconetworking
  • ethstaker
  • anitta
  • Leos
  • megavids
  • normalnudes
  • provamag3
  • lostlight
  • All magazines