This roadmap outlines the path from current state (lexer + parser) to a complete, production-ready language.
Current State Goal
│ │
▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐
│ Lexer │ → │ Parser │ → │ Type │ → │ Codegen │ → │ Runtime │
│ ✅ │ │ ✅ │ │ Checker │ │ WASM │ │ Rust │
└─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
┌────────┐ ┌─────────┐ ┌─────────┐
│ Borrow │ │ Effect │ │Refinemt │
│Checker │ │Inference│ │ SMT │
└────────┘ └─────────┘ └─────────┘
Status: Done
-
✓ Project structure (Dune)
-
✓ Lexer (Sedlex)
-
✓ Parser (Menhir)
-
✓ AST definitions
-
✓ Error infrastructure
-
✓ CLI skeleton
-
✓ Test framework
-
✓ Academic documentation
Goal: Type check simple programs without effects or ownership
Duration: 8-12 weeks
-
❏ Symbol table structure
-
❏ Scope management
-
❏ Module path resolution
-
❏ Import resolution
-
❏ Visibility checking (pub, pub(crate), etc.)
Files: lib/resolve.ml, lib/symbol.ml
-
❏ Kind inference
-
❏ Kind unification
-
❏ Higher-kinded types
-
❏ Row kinds
-
❏ Effect kinds
Files: lib/kind.ml
-
❏ Bidirectional type checking
-
❏ Type synthesis
-
❏ Type checking mode
-
❏ Subsumption rule
Files: lib/typecheck.ml, lib/check.ml, lib/synth.ml
-
❏ Type unification
-
❏ Occurs check
-
❏ Union-find structure
-
❏ Error messages for unification failures
Files: lib/unify.ml, lib/union_find.ml
-
❏ Record row unification
-
❏ Variant row unification
-
❏ Lacks constraints
-
❏ Row rewriting
Files: lib/row_unify.ml
Goal: Full QTT and effect system
Duration: 8-12 weeks
-
❏ Quantity context tracking
-
❏ Context scaling
-
❏ Context addition
-
❏ Usage analysis
-
❏ Quantity error messages
Files: lib/quantity.ml
-
❏ Effect signature checking
-
❏ Effect row inference
-
❏ Handler typing
-
❏ Effect unification
-
❏ Effect polymorphism
Files: lib/effect.ml, lib/effect_infer.ml
-
❏ Handler completeness
-
❏ Return clause typing
-
❏ Operation clause typing
-
❏ Continuation typing (linear vs multi-shot)
Goal: Memory safety verification
Duration: 6-10 weeks
-
❏ Move semantics
-
❏ Ownership transfer
-
❏ Drop insertion
-
❏ Copy trait handling
Files: lib/ownership.ml
-
❏ Borrow tracking
-
❏ Conflict detection
-
❏ Non-lexical lifetimes
-
❏ Dataflow analysis
Files: lib/borrow.ml, lib/dataflow.ml
-
❏ Lifetime constraints
-
❏ Lifetime solving
-
❏ Lifetime elision
-
❏ Lifetime bounds
Files: lib/lifetime.ml
Goal: Dependent types with SMT verification
Duration: 6-10 weeks
-
❏ Π-type checking
-
❏ Σ-type checking
-
❏ Type-level computation
-
❏ Normalization
Files: lib/dependent.ml, lib/normalize.ml
-
❏ Z3 OCaml bindings
-
❏ Predicate translation
-
❏ Validity checking
-
❏ Model extraction (for errors)
Files: lib/smt.ml, lib/smt_translate.ml
-
❏ Refinement subtyping
-
❏ VC generation
-
❏ SMT queries
-
❏ Refinement error messages
Files: lib/refinement.ml
Goal: Compile to WebAssembly
Duration: 10-14 weeks
-
❏ ANF transformation
-
❏ Effect evidence insertion
-
❏ Closure conversion
-
❏ Lambda lifting
Files: lib/ir.ml, lib/anf.ml, lib/closure.ml
-
❏ Dead code elimination
-
❏ Inlining
-
❏ Constant folding
-
❏ Linearity-aware optimizations
Files: lib/optimize.ml
-
❏ WASM module structure
-
❏ Function compilation
-
❏ Type mapping
-
❏ Memory layout
Files: lib/wasm.ml, lib/codegen.ml
-
❏ Evidence-passing transform
-
❏ Handler compilation
-
❏ Continuation representation
-
❏ One-shot optimization
Files: lib/effect_compile.ml
Goal: Minimal Rust runtime for WASM
Duration: 6-8 weeks
-
❏ Project structure
-
❏ Memory allocator
-
❏ Panic handling
-
❏ Stack management
Location: runtime/ (new Rust crate)
-
❏ Evidence structures
-
❏ Handler frames
-
❏ Continuation allocation
-
❏ Resume implementation
Goal: Usable standard library
Duration: Ongoing (8+ weeks initial)
-
❏ List
-
❏ Vec (growable array)
-
❏ HashMap
-
❏ HashSet
-
❏ BTreeMap
Location: stdlib/collections/
-
❏ IO effect
-
❏ State effect
-
❏ Exn effect
-
❏ Async effect
-
❏ Reader effect
Location: stdlib/effects/
Goal: Developer experience
Duration: Ongoing (10+ weeks initial)
-
❏ LSP implementation
-
❏ Diagnostics
-
❏ Hover information
-
❏ Go to definition
-
❏ Find references
-
❏ Completion
-
❏ Rename
Location: tools/affinescript-lsp/
-
❏ Canonical formatting
-
❏ Configuration options
-
❏ Editor integration
Location: lib/format.ml, bin/fmt.ml
-
❏ Expression evaluation
-
❏ Type printing
-
❏ Effect handling
-
❏ History
Location: bin/repl.ml
-
❏ Manifest parsing
-
❏ Dependency resolution
-
❏ Package fetching
-
❏ Lock file
-
❏ Publishing
Location: tools/affine-pkg/
Goal: Community and adoption
Duration: Ongoing
-
❏ Syntax highlighting
-
❏ LSP client
-
❏ Snippets
-
❏ Debugging
Location: editors/vscode/
| Version | Contents | Target |
|---|---|---|
0.1.0 |
Type checker (no effects/ownership) |
Phase 1 |
0.2.0 |
Full type system |
Phase 2-4 |
0.3.0 |
WASM compilation |
Phase 5-6 |
0.4.0 |
Standard library |
Phase 7 |
0.5.0 |
Tooling (LSP, formatter) |
Phase 8 |
0.9.0 |
Release candidate |
Phase 9 |
1.0.0 |
Stable release |
All phases |
-
❏ 100+ test programs type check correctly
-
❏ Error messages are helpful
-
❏ <1s for typical file