Releases: aallan/vera
Release list
v0.0.20 — Consolidation
Consolidation release
No new compiler features — this release focuses on documentation hygiene, spec correctness, and test coverage.
Fixed
- Spec @t notation: corrected 30 code blocks across 5 spec files where
@Twas incorrectly used in data constructor fields and effect operation signatures - Stale README limitations: removed rows for closures (#27) and effect handlers (#28), closed in v0.0.18/v0.0.19
- Spec limitation tracking: created issues #50–#53 for all previously unlinked limitations in Chapter 11; added
limitationlabel
Added
- 104 new tests (795 total, up from 691):
test_types.py— 55 tests for type operationstest_wasm.py— 22 tests for WASM internalstest_errors.py— 18 new tests for diagnosticstest_cli.py— 10 new tests for error paths
Changed
- Spec allowlist cleaned: 0 MISMATCH entries (was 30), 37 blocks parse OK (was 21)
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)
v0.0.18: Closure compilation (C6h)
C6h: Closure Compilation
Compile anonymous functions and closures to WASM via function tables and call_indirect.
Added
- Closure representation: heap-allocated struct [func_table_idx: i32, captures...] as i32 pointer
- Function table infrastructure: closure signature types, funcref table, element segments
- Closure lifting: anonymous functions compiled as module-level WASM functions with $env parameter
- Free variable capture: detect SlotRef nodes referencing outer-scope bindings
- apply_fn built-in emitting call_indirect
- Function type aliases resolved to i32 closure pointers
- Reworked examples/closures.vera with make_adder, apply, map_option
- 17 new codegen tests (677 total)
v0.0.17: Generics monomorphization (C6i)
C6i: Generics Monomorphization
Compile forall<T> functions to WASM via monomorphization.
Added
- Collection pass: walk non-generic bodies to find calls to generic functions, infer type bindings
- AST substitution: create monomorphized FnDecl copies with type variables replaced
- Name mangling: identity + (Int,) becomes identity$Int
- Call rewriting: generic calls resolve to mangled names at WASM translation time
- FnCall type inference for if-branches and chained calls
- 17 new codegen tests (660 total)
v0.0.16: Match expression codegen (C6g)
C6g: Match Expression Codegen
Compile MatchExpr AST nodes to WASM chained if-else cascades.
Added
- ADT tag dispatch: load tag from heap pointer, compare, branch
- Field extraction at computed offsets into locals
- Pattern types: ConstructorPattern, NullaryPattern, WildcardPattern, BindingPattern, BoolPattern, IntPattern
- Recursive if-else cascade with environment scoping per arm
- 20 new codegen tests (643 total)
v0.0.15: ADT constructor codegen (C6f)
C6f: ADT Constructor Codegen
Compile ConstructorCall and NullaryConstructor AST nodes to WASM heap-allocated tagged unions.
Added
- Nullary constructors: alloc, store tag, return pointer
- Constructors with fields: alloc, store tag, store fields at computed offsets, return pointer
- Field offsets computed from concrete argument types (handles monomorphized generics)
- ADT types compile to i32 (heap pointer) in signatures and type inference
- 12 new codegen tests (623 total)
PR: #40
v0.0.14: Bump allocator infrastructure (C6e)
C6e: Bump Allocator Infrastructure
Heap allocation support for ADT constructor codegen.
Added
- $heap_ptr mutable global with 8-byte aligned bump allocation
- $alloc internal function
- ConstructorLayout dataclass: tag, field offsets, total size per constructor
- Allocator emitted only when user-declared ADTs are present
- 26 new codegen tests (611 total)
PR: #39
v0.0.13: State<T> WASM host imports (C6d)
C6d: State<T> WASM Host Imports
Compile get/put operations for State<T> effects as WASM host imports.
Added
- State<Int>, State<Nat>, State<Bool>, State<Float64> compile to typed host import pairs
- get(()) compiles to call $vera.state_get_T; put(x) compiles to call $vera.state_put_T
- Host runtime maintains mutable state cells per type
- execute() accepts optional initial_state and returns final state
- Mixed effects supported: effects(<State<Int>, IO>)
- 15 new codegen tests (585 total)
- examples/increment.vera now compiles and runs
PR: #38
v0.0.12: Match exhaustiveness checking (C6c)
C6c: Match Exhaustiveness Checking
Compile-time verification that match expressions cover all possible values.
Added
- ADT exhaustiveness: all constructors covered or catch-all present
- Bool exhaustiveness: both true and false covered
- Infinite type exhaustiveness: Int, String, Float64, Nat require wildcard
- Unreachable arm warnings
- 17 new type checker tests (570 total)
v0.0.11: Callee precondition verification (C6b)
C6b: Callee Precondition Verification
Modular call-site contract checking — when function f calls function g, verify preconditions hold.
Added
- Callee precondition checking at call sites with Z3
- Callee postconditions assumed at call sites for symbolic reasoning
- Recursive functions now verify ensures() at Tier 1 instead of Tier 3 fallback
- CallViolation dataclass and diagnostics
- 13 new verifier tests (553 total)