session
Resumable effect handlers, structured concurrency, graph-coloring regalloc
The concurrency and effects story is complete at the language level. Everything below is in main and covered by tests (test_effect_resume, test_effect_noresume, test_effect_compose, test_spawn_scope, test_cancellation).
Effect handlers with continuations
resume(cont, value): a handler arm can now continue thehandleblock from the point of thedo, withvalueas the result of the effect. New keyword, AST node, parser, type checker, and lowering.- Continuation capture at lowering time: the statements after a
doare captured as a continuation closure (lambda-lifted, called throughCallPtr), so there is no runtime scheduler and no hidden allocation behind an effect. - No resume means no continuation: a handler that returns without
resumedrops the rest of the block, which gives cooperative cancellation for free. - Chaining: multiple
dostatements in one block each capture their own continuation; nested handlers resolve at the nearest enclosinghandle.
Structured concurrency and cancellation
spawn scope { … }: a scope-owned executor runs everyspawninside the block and joins them all at the closing brace. Tasks cannot outlive their scope.cancel scope;: cancels all pending tasks in the enclosing scope, backed by the newp_executor_cancelruntime builtin.do Cancel.stop(): cooperative cancellation through effect dispatch.- No function coloring, verified: any function is callable from synchronous code, a spawned task, or a handler body; there is no
async fn/fnsplit to maintain.
Async I/O as effects
do IO.read/do IO.writeanddo Net.acceptdispatch to handlers and resume with the result. A request handler reads as straight-line code even though every I/O point is a suspension.
Compiler and backends
- Graph-coloring register allocator (Chaitin-Briggs) added alongside linear scan, with function alignment for the native backends.
- Deterministic PE code generation: the Windows emitter now produces identical bytes for identical input, build after build.
- Cached parsing: repeated compiles of unchanged modules skip the parser.
- Struct globals in the C backend: initialized correctly as inline values.
Standard library
- 104 modules. New since 1.0:
arena(bump allocator with O(1) bulk free),template(typed template rendering),plot(SVG line/bar/scatter plots),data(CSV loading and schema inference), andgame(an ECS-plus-frame-arena engine framework in which Fid is its own scripting language).