v0.0.19: Effect handler compilation (C6j)
C6j: Effect Handler Compilation
Compile handle[State<T>] expressions to WASM via host imports.
Added
- State handler translation:
handle[State<T>](@T = init) { get/put clauses } in { body }compiles by initializing state viastate_put_T, then compiling body with get/put mapped to host imports - Handler clauses serve as specifications (not compiled) —
resume()calls describe the default State semantics, validated by type checker - Effect discharge: pure functions containing
handle[State<T>]are compilable — state imports registered by scanning function body for handle expressions - Unsupported handlers (Exn, custom effects) cause function to be skipped with warning
- Reworked
examples/effect_handler.vera: addedtest_state_initandtest_put_get - 14 new codegen tests (691 total)