Problem
Home code has no way to run in parallel. The lexer has no spawn keyword. packages/threading/src/bindings/sync.home (983 lines) declares @extern fn thread_spawn/mutex_create/..., but nothing exports those symbols. The interpreter's WorkerPool.spawn runs closures synchronously, and awaiting a pending future quietly returns Void. Native codegen says "We don't yet have an executor" — block_on busy-polls. examples/wip/async_example.home already uses spawn / Mutex<T>. (New direction.)
Evidence (origin/main @ d4b219507)
packages/lexer/src/token.zig:393-455packages/threading/src/bindings/sync.homepackages/interpreter/src/interpreter.zig:7980-8000packages/interpreter/src/interpreter.zig:1790packages/codegen/src/native_codegen.zig:6122-6137packages/codegen/src/native_codegen.zig:6531-6570examples/wip/async_example.home
Scope
- Language:
spawn(thread) and task spawning on a multi-core executor;JoinHandle, scoped threads. - Export the
sync.homeextern symbols from the runtime (Mutex, CondVar, channels, Arc). - Interpreter: real threads; awaiting a pending future blocks or errors, never returns
Void. - Native: a real executor instead of busy-poll
block_on.
Acceptance criteria
- A parallel sum in
.homeover 8 threads is ≥4× faster than single-threaded on native and interpreter builds. examples/wip/async_example.homemoves out ofwip/and runs.