WasmFX: Effect Handlers for WebAssembly
41–44 of 44 posts
Re: WasmFX: Effect Handlers for WebAssembly
#42Earlier quoted context omitted.
WASM is used to implement all kinds of control flow in other languages, so here it makes a lot of sense to have a lower level abstraction. The languages on top of WASM will still have exceptions, generators, etc.
I was thinking the same thing: surely the needs of low-level languages intended as compilation targets are different from languages intended to be programmed in directly? Especially if the goal is to be able to accommodate different high-level language paradigms, which WASM seems to be aiming for.
Re: WasmFX: Effect Handlers for WebAssembly
#43Earlier quoted context omitted.
The point, as exhibited by the practical issues around Scheme’s call/cc, is that it can be very hard to make different libraries work together when each of them makes use of such control-flow primitives. It definitely doesn’t happen by default—if you just use them at the same time, the result will run, but it won’t make sense (or obey the individual libraries’ invariants). So if you’re happy to fence off the generali…
Call/cc is generally considered a bad primitive now, superseded by delimited continuations that compose nicely.
Re: WasmFX: Effect Handlers for WebAssembly
#44I first heard of algebraic effects in a presentation about Unison recorded at Strangeloop. Realizing that exceptions, async, generators, and continuations could all be unified and implemented on top of one language feature was mind expanding. It looks like the juicy details are in the Explainer: https://github.com/WebAssembly/stack-switching/blob/main/pro...
Does this approach avoid function coloring? That is: do legacy calls of functions containing yield instructions just treat these as nop?