Roadmap
This roadmap shows our planned development direction. Priorities may shift based on community feedback and technical requirements.
Current State: Alpha - Core language implemented (types, functions, pattern matching, modules, register-based VM)
Phase 1: Foundation Hardening
49/59 tasks
Goal: Solidify the runtime for reliable development
1.1 Memory Management
6/6 (100%)- ☑ Implement garbage collection
- ☑ Mark-sweep GC strategy
- ☑ Track heap allocations (tuples, lists, records, closures)
- ☑ Implement collection cycle triggering (threshold-based)
- ☑ Add GC tuning parameters (GC_THRESHOLD constant)
- ☑ Automatically increase register count when 64 registers exceeded
1.2 Type System
5/6 (83%)- ☑ Parametric/generic enum types
- ☑ Lambda type inference for native stdlib functions
- ☑ Multi-parameter lambdas work with foldl, foldr, zipWith (fixed curried type extraction)
- ☑ Native functions work with pipes and composition
- ☑ Typed record fields in lambda patterns
- ☐ Implicit scalar-to-Expr coercion for DataFrame.Expr
1.3 VM Optimizations
0/3 (0%)- ☐ Tail call optimization
- ☐ Bitwise NOT operator for integers
- ☐ Instruction fusion for common patterns
1.4 Compiler Optimizations
11/15 (73%)- ☑ Constant folding
- ☑ Arithmetic operations (
+,-,*,/,//,%,^) - ☑ Comparison operations (
==,!=,<,<=,>,>=) - ☑ Boolean operations (
&&,||,not) - ☑ String concatenation (
++) - ☑ List cons (
::) - ☑ If-then-else with constant conditions
- ☑ Variable lookup for
let-bound constants - ☑ Stdlib function const-eval registry (Math.abs, String.length, List.length, etc.)
- ☑ Lambda-safe folding (parameters shadow outer variables correctly)
- ☑ Comprehensive test suite (57 tests covering arithmetic, strings, booleans, edge cases)
- ☐ Dead code elimination
- ☐ Common subexpression elimination
- ☐ Instruction peephole optimization
- ☐ Unused binding warnings
1.5 Testing & Quality
27/29 (93%)- ☐ Achieve 100% test coverage
- ☑ Refactor all tests to use VmError variants instead of string matching
- ☑ Add property-based tests (using proptest or quickcheck)
- ☑ Import system test coverage (18 tests for error conditions, 3 stdlib import tests)
- ☑ Lexer robustness tests (arbitrary string/UTF-8 input)
- ☑ Arithmetic property tests (commutativity, associativity, identity)
- ☑ Boolean logic tests (commutativity, double negation)
- ☑ List operation tests (concatenation associativity, identity, cons equivalence)
- ☑ Document all public APIs with Rust doc comments
- ☑ Comprehensive parser documentation (all parser modules documented)
- ☑ Add integration tests for complex programs
- ☐ Add example keel projects with multiple files and modules to integration tests
- ☑ Add a unified KeelError enum which the compiler outputs and which handles all other errors
- ☑ KeelError wraps LexerError, ParserError, ScopeError, TypeError, CompileError, VmError
- ☑ ErrorHint trait implemented for all error types (hint and note methods)
- ☑ KeelError delegates hint/note to inner types
- ☑ 100% error hint coverage across all error variants (115 variants with hints/notes)
- ☑ "Did you mean?" suggestions for module function typos
- ☑
UndeclaredModuleFunctionerror with fuzzy-matched suggestions from module exports - ☑ Works with all stdlib modules (List, String, Math, IO) and user modules
- ☑ Helpful error for
type Name = { record }syntax mistake - ☑ Detects when users write
type X = { ... }instead oftype alias X = { ... } - ☑ Provides clear hint and note explaining the difference between
type(enums) andtype alias(records) - ☑ Helpful error for tuple pattern type annotations
- ☑ Detects when users write
|(x, y): (Int, Int)|instead of|(x: Int, y: Int)| - ☑ Provides hint showing correct syntax and note explaining type annotations go on individual elements
- ☑ Helpful error for missing parentheses in enum variants
- ☑ Detects when users write
Ok ainstead ofOk(a)in enum definitions - ☑ Provides hint showing correct syntax (
Ok(a)instead ofOk a) and note explaining variant data syntax
Phase 2: Standard Library & IO
167/182 tasks
Goal: Make Keel capable of real programs
2.1 Module System Completion
3/5 (60%)- ☑ File inlining with
inline "file"expression - ☑ Cross-file imports via
inline - ☑ Circular dependency detection
- ☐ File-based module loading
- ☐ Module caching for faster reloads
2.2 Std.List
34/34 (100%)- ☑
map : (a -> b) -> List a -> List b - ☑
filter : (a -> Bool) -> List a -> List a - ☑
foldl : (b -> a -> b) -> b -> List a -> b - ☑
foldr : (a -> b -> b) -> b -> List a -> b - ☑
concat : List (List a) -> List a - ☑
reverse : List a -> List a - ☑
take : Int -> List a -> List a - ☑
drop : Int -> List a -> List a - ☑
zip : List a -> List b -> List (a, b) - ☑
zipWith : (a -> b -> c) -> List a -> List b -> List c - ☑
length : List a -> Int - ☑
head : List a -> Maybe a - ☑
tail : List a -> [a] - ☑
last : List a -> Maybe a - ☑
init : List a -> Maybe (List a) - ☑
nth : Int -> List a -> Maybe a - ☑
any : (a -> Bool) -> List a -> Bool - ☑
all : (a -> Bool) -> List a -> Bool - ☑
find : (a -> Bool) -> List a -> Maybe a - ☑
partition : (a -> Bool) -> List a -> (List a, List a) - ☑
sort : List comparable -> List comparable - ☑
sortBy : (a -> comparable) -> List a -> List a - ☑
unique : List comparable -> List comparable - ☑
range : Int -> Int -> List Int - ☑
repeat : Int -> a -> List a - ☑
intersperse : a -> List a -> List a - ☑
sum : List number -> number - ☑
product : List number -> number - ☑
maximum : List a -> Maybe a - ☑
minimum : List a -> Maybe a - ☑
isEmpty : List a -> Bool - ☑
member : a -> List a -> Bool - ☑
singleton : a -> List a - ☑
append : List a -> List a -> List a
2.3 Std.String
30/30 (100%)- ☑
length : String -> Int - ☑
isEmpty : String -> Bool - ☑
contains : String -> String -> Bool - ☑
startsWith : String -> String -> Bool - ☑
endsWith : String -> String -> Bool - ☑
split : String -> String -> List String - ☑
join : String -> List String -> String - ☑
trim : String -> String - ☑
trimLeft : String -> String - ☑
trimRight : String -> String - ☑
toUpper : String -> String - ☑
toLower : String -> String - ☑
replace : String -> String -> String -> String - ☑
slice : Int -> Int -> String -> String - ☑
charAt : Int -> String -> Maybe String - ☑
toList : String -> List String - ☑
fromList : List String -> String - ☑
lines : String -> List String - ☑
unlines : List String -> String - ☑
words : String -> List String - ☑
unwords : List String -> String - ☑
padLeft : Int -> String -> String -> String - ☑
padRight : Int -> String -> String -> String - ☑
reverse : String -> String - ☑
toInt : String -> Maybe Int - ☑
toFloat : String -> Maybe Float - ☑
fromInt : Int -> String - ☑
fromFloat : Float -> String - ☑
repeat : Int -> String -> String - ☑
concat : List String -> String
2.4 Std.IO
32/32 (100%)- ☑ add permission env vars and IO errors
- ☑
print : a -> IO Unit- Print value to stdout - ☑
println : a -> IO Unit- Print value with newline to stdout - ☑
eprint : a -> IO Unit- Print value to stderr - ☑
eprintln : a -> IO Unit- Print value with newline to stderr - ☑
readLine : IO String- Read line from stdin - ☑
readFile : String -> IO (Result String String)- Read file contents - ☑
writeFile : String -> String -> IO (Result Unit String)- Write to file - ☑
appendFile : String -> String -> IO (Result Unit String)- Append to file - ☑
fileExists : String -> IO Bool- Check if file exists - ☑
deleteFile : String -> IO (Result Unit String)- Delete file - ☑
copyFile : String -> String -> IO (Result Unit String)- Copy file - ☑
renameFile : String -> String -> IO (Result Unit String)- Rename/move file - ☑
isDir : String -> IO Bool- Check if path is directory - ☑
isFile : String -> IO Bool- Check if path is file - ☑
getFileSize : String -> IO (Result Int String)- Get file size in bytes - ☑
listDir : String -> IO (Result (List String) String)- List directory contents - ☑
getCurrentDir : IO String- Get current working directory - ☑
setCurrentDir : String -> IO (Result Unit String)- Change working directory - ☑
createDir : String -> IO (Result Unit String)- Create directory - ☑
createDirAll : String -> IO (Result Unit String)- Create directory and parents - ☑
removeDir : String -> IO (Result Unit String)- Remove empty directory - ☑
removeDirAll : String -> IO (Result Unit String)- Remove directory recursively - ☑
joinPath : String -> String -> String- Join path components - ☑
parentDir : String -> Maybe String- Get parent directory - ☑
fileName : String -> String- Get filename from path - ☑
extension : String -> Maybe String- Get file extension - ☑
absolutePath : String -> IO (Result String String)- Resolve to absolute path - ☑
getEnv : String -> IO (Maybe String)- Get environment variable - ☑
setEnv : String -> String -> IO Unit- Set environment variable - ☑
getArgs : IO (List String)- Get command line arguments - ☑
exit : Int -> IO Unit- Exit with code
2.5 Std.Math
37/37 (100%)- ☑
abs : number -> number - ☑
min : comparable -> comparable -> comparable - ☑
max : comparable -> comparable -> comparable - ☑
clamp : comparable -> comparable -> comparable -> comparable - ☑
floor : Float -> Int - ☑
ceil : Float -> Int - ☑
round : Float -> Int - ☑
truncate : Float -> Int - ☑
sqrt : Float -> Float - ☑
pow : Float -> Float -> Float - ☑
exp : Float -> Float - ☑
log : Float -> Float - ☑
log10 : Float -> Float - ☑
log2 : Float -> Float - ☑
sin : Float -> Float - ☑
cos : Float -> Float - ☑
tan : Float -> Float - ☑
asin : Float -> Float - ☑
acos : Float -> Float - ☑
atan : Float -> Float - ☑
atan2 : Float -> Float -> Float - ☑
sinh : Float -> Float - ☑
cosh : Float -> Float - ☑
tanh : Float -> Float - ☑
pi : Float - ☑
e : Float - ☑
isNaN : Float -> Bool - ☑
isInfinite : Float -> Bool - ☑
isFinite : Float -> Bool - ☑
sign : number -> Int - ☑
negate : number -> number - ☑
rem : Int -> Int -> Int - ☑
gcd : Int -> Int -> Int - ☑
lcm : Int -> Int -> Int - ☑
toFloat : Int -> Float - ☑
degrees : Float -> Float - ☑
radians : Float -> Float
2.6 Std.Http
5/5 (100%)- ☑
get,post,put,patch,delete,request— pure request-building functions returning Records - ☑
withHeader,withHeaders,withBody,withJsonBody,withTimeout,withQueryParam— modifier functions - ☑
send— performs the actual HTTP request - ☑
jsonBody— parses response body as JSON - ☑ Security controls:
KEEL_HTTP_DISABLED(default: disabled),KEEL_HTTP_ALLOWED_HOSTS(domain allowlist)
2.7 Std.Json
4/4 (100%)- ☑
parse— JSON string → Keel values (objects→Records, arrays→Lists, etc.) - ☑
parseString,parseInt,parseFloat,parseBool— type-specific safe extraction - ☑
encode,encodePretty— Keel values → JSON strings - ☑
get— extract field from JSON string
2.8 Std.Result
6/6 (100%)- ☑
map : (a -> b) -> Result a e -> Result b e - ☑
mapError : (e -> f) -> Result a e -> Result a f - ☑
andThen : (a -> Result b e) -> Result a e -> Result b e - ☑
withDefault : a -> Result a e -> a - ☑
toMaybe : Result a e -> Maybe a - ☑
fromMaybe : e -> Maybe a -> Result a e
2.9 Std.Maybe
3/3 (100%)- ☑
map : (a -> b) -> Maybe a -> Maybe b - ☑
andThen : (a -> Maybe b) -> Maybe a -> Maybe b - ☑
withDefault : a -> Maybe a -> a
2.10 Std.DataFrame
13/13 (100%)- ☑ Polars-backed tabular data analysis (36 functions)
- ☑ I/O:
readCsv,readJson,readParquet,writeCsv,writeJson - ☑ Column ops:
select,drop,rename,withColumn,column,columns,dtypes - ☑ Row ops:
head,tail,slice,sort,sortDesc,unique,sample - ☑ Filters:
filterEq,filterNeq,filterGt,filterGte,filterLt,filterLte,filterIn - ☑ Aggregation:
groupBy,agg(sum/mean/min/max/count/first/last/std/var/median),count,describe - ☑ Multi-DataFrame:
join(inner),concat,pivot - ☑ Inspection:
shapereturns(rows, columns)tuple - ☑ Conversion:
toRecords,fromRecords - ☑ Rich column-aligned table display (head 5 + tail 5 with
…for >10 rows) - ☑ NativeObject infrastructure with type-specific display callbacks
- ☑ Security controls:
KEEL_DATAFRAME_DISABLED,KEEL_DATAFRAME_SANDBOX,KEEL_DATAFRAME_MAX_ROWS - ☑ Structured error variants:
DataFrameDisabled,DataFrameSandboxViolation,DataFrameFileError,DataFrameColumnNotFound,DataFrameOperationError
2.11 Std.Dict (Optional)
0/13 (0%)- ☐
empty : Dict k v - ☐
singleton : k -> v -> Dict k v - ☐
insert : k -> v -> Dict k v -> Dict k v - ☐
get : k -> Dict k v -> Maybe v - ☐
remove : k -> Dict k v -> Dict k v - ☐
member : k -> Dict k v -> Bool - ☐
keys : Dict k v -> List k - ☐
values : Dict k v -> List v - ☐
toList : Dict k v -> List (k, v) - ☐
fromList : List (k, v) -> Dict k v - ☐
map : (v -> w) -> Dict k v -> Dict k w - ☐
filter : (k -> v -> Bool) -> Dict k v -> Dict k v - ☐
size : Dict k v -> Int
Phase 3: Developer Experience
15/40 tasks
Goal: Make Keel pleasant to use
3.1 Pretty Printing
0/4 (0%)- ☐ Pretty-print values with colors
- ☐ Pretty-print types with formatting
- ☐ Rich error messages with:
- ☐ Configurable output width
3.2 Table & Structured Output
1/4 (25%)- ☑ ASCII table formatter (DataFrame display with column alignment, dtype rows, truncation with
…) - ☐ Markdown table output
- ☐ JSON output mode
- ☐ CSV output mode
3.3 Documentation System
3/7 (42%)- ☑ Doc comment syntax:
{-| ... -}(Elm-style) - ☑ Parse and store doc comments in AST (
Comment { is_doc: true }) - ☑ Comprehensive doc comment test suite (lexer + compiler integration tests)
- ☐ Doc tests: extract and run code examples
- ☐ HTML documentation generator
- ☐ Markdown documentation generator
- ☐ Search functionality for docs
3.4 Editor Tooling
8/12 (66%)- ☑ Treesitter grammar (keel-tree-sitter)
- ☑ Language Server Protocol (keel-lsp)
- ☑ Go to definition
- ☐ Find references
- ☑ Hover type info (FunctionDoc with to_markdown(), rich ModuleDoc with type explanations and examples)
- ☑ Completions
- ☑ Diagnostics
- ☐ Code actions (import suggestions)
- ☑ Shared token-to-byte source mapping (
lexer::token_spans) used by both LSP and time machine - ☑ Zed extension (keel-zed-extension)
- ☐ VSCode extension
- ☐ Neovim plugin
3.5 REPL Improvements
2/8 (25%)- ☐ Command history (persistent across sessions)
- ☑ Tab completion for identifiers
- ☐ Multi-line editing
- ☐
:typecommand to show expression types - ☐
:doccommand to show docstrings - ☐
:loadcommand to load files - ☐
:reloadcommand - ☑ Syntax highlighting in REPL
3.6 Debugging & Profiling
1/5 (20%)- ☑ Time machine debugging (feature flag:
time-machine) - ☐ Step-through debugger (REPL integration)
- ☐ Profiler for function call times
- ☐ Memory usage tracking
- ☐ Built-in benchmark system
Phase 4: Data Science Core
0/81 tasks
Goal: Enable data science workflows
4.1 Matrix Type
0/23 (0%)- ☐ Native Matrix type (2D numeric array)
- ☐ Matrix literal syntax:
[| 1, 2; 3, 4 |] - ☐ Element types: Int matrix, Float matrix
- ☐ Shape tracking in type system
- ☐ Operations:
- ☐ Element-wise arithmetic (+, -, *, /)
- ☐ Matrix multiplication (
@ormatmul) - ☐ Transpose
- ☐ Element access:
m[i, j]orm.(i, j) - ☐ Row/column slicing
- ☐ Broadcasting for scalar operations
- ☐ Construction:
- ☐
zeros : Int -> Int -> Matrix Float - ☐
ones : Int -> Int -> Matrix Float - ☐
identity : Int -> Matrix Float - ☐
fromLists : List (List a) -> Matrix a - ☐
range : Int -> Int -> Matrix Int - ☐ Linear algebra:
- ☐
det : Matrix Float -> Float - ☐
inverse : Matrix Float -> Maybe (Matrix Float) - ☐
solve : Matrix Float -> Matrix Float -> Matrix Float - ☐
eigenvalues : Matrix Float -> List Float - ☐
svd : Matrix Float -> (Matrix Float, List Float, Matrix Float)
4.2 Dataframe Type
0/5 (0%)- ☐ DataFrame literal syntax:
df { name: ["a", "b"], value: [1, 2] } - ☐ Column access syntax:
df.column_nameordf["column_name"] - ☐ Row access syntax:
df[0]returns record - ☐ Expression-based filter:
filter : (Row -> Bool) -> DataFrame -> DataFrame - ☐ Column map:
mapColumn : String -> (a -> b) -> DataFrame -> DataFrame
4.3 Statistics Module
0/12 (0%)- ☐
mean : List Float -> Float - ☐
median : List Float -> Float - ☐
mode : List comparable -> Maybe comparable - ☐
variance : List Float -> Float - ☐
stddev : List Float -> Float - ☐
correlation : List Float -> List Float -> Float - ☐
covariance : List Float -> List Float -> Float - ☐
percentile : Float -> List Float -> Float - ☐
histogram : Int -> List Float -> List Int - ☐
linearRegression : List (Float, Float) -> (Float, Float) - ☐
tTest : List Float -> List Float -> Float - ☐
chiSquare : List Int -> List Float -> Float
4.4 Distributions Module
0/37 (0%)- ☐ RNG state management
- ☐
setSeed : Int -> IO Unit - ☐
getSeed : IO Int - ☐ Continuous distributions
- ☐
uniform : Float -> Float -> Distribution Float - ☐
normal : Float -> Float -> Distribution Float(mean, stddev) - ☐
exponential : Float -> Distribution Float(rate) - ☐
gamma : Float -> Float -> Distribution Float(shape, scale) - ☐
beta : Float -> Float -> Distribution Float(alpha, beta) - ☐
logNormal : Float -> Float -> Distribution Float - ☐
cauchy : Float -> Float -> Distribution Float(location, scale) - ☐
studentT : Float -> Distribution Float(degrees of freedom) - ☐
chiSquared : Float -> Distribution Float(degrees of freedom) - ☐
f : Float -> Float -> Distribution Float(df1, df2) - ☐ Discrete distributions
- ☐
bernoulli : Float -> Distribution Bool - ☐
binomial : Int -> Float -> Distribution Int(n, p) - ☐
poisson : Float -> Distribution Int(lambda) - ☐
geometric : Float -> Distribution Int(p) - ☐
negativeBinomial : Int -> Float -> Distribution Int - ☐
categorical : List (a, Float) -> Distribution a - ☐ Sampling (IO because it consumes RNG state)
- ☐
sample : Distribution a -> IO a - ☐
sampleN : Int -> Distribution a -> IO (List a) - ☐
sampleList : Int -> List a -> IO (List a)(sample without replacement) - ☐
shuffle : List a -> IO (List a) - ☐
choice : List a -> IO a - ☐ Distribution properties (pure functions)
- ☐
pdf : Distribution Float -> Float -> Float - ☐
cdf : Distribution Float -> Float -> Float - ☐
quantile : Distribution Float -> Float -> Float - ☐
distMean : Distribution Float -> Float - ☐
distVariance : Distribution Float -> Float - ☐
distStddev : Distribution Float -> Float - ☐ Multivariate distributions
- ☐
multivariateNormal : List Float -> Matrix Float -> Distribution (List Float) - ☐
dirichlet : List Float -> Distribution (List Float)
4.5 Output Formats
0/4 (0%)- ☐ LaTeX output for matrices and tables
- ☐ Typst output
- ☐ HTML output with styling
- ☐ Plot descriptions (for external rendering)
Phase 5: Performance & Interop
0/17 tasks
Goal: Scale to large computations
5.1 Parallel Computing
0/7 (0%)- ☐ Task graph infrastructure
- ☐ Parallel combinators:
- ☐
pmap : (a -> b) -> List a -> List b - ☐
parFilter : (a -> Bool) -> List a -> List a - ☐
parFold : (b -> a -> b) -> b -> List a -> b - ☐ Thread pool management
- ☐ Work stealing scheduler
5.2 Foreign Function Interface (FFI)
0/4 (0%)- ☐ Rust FFI
- ☐ Python FFI
- ☐ R FFI
- ☐ Julia FFI
5.3 Compilation Targets
0/3 (0%)- ☐ WebAssembly (WASM) compilation
- ☐ Ahead-of-time native compilation
- ☐ JIT compilation for hot functions
5.4 Additional Optimizations
0/3 (0%)- ☐ SIMD vectorization for numeric operations
- ☐ Memory-mapped file support for large datasets
- ☐ Lazy evaluation for infinite data structures
Phase 6: Ecosystem
1/29 tasks
Goal: Build a sustainable language ecosystem
6.1 Package Manager
0/16 (0%)- ☐ Package specification format (keel.toml)
- ☐ CLI commands:
- ☐
keel init- create new project - ☐
keel add- add dependency - ☐
keel remove- remove dependency - ☐
keel install- install all dependencies - ☐
keel build- build project - ☐
keel run- run main module - ☐
keel test- run tests - ☐
keel bench- run benchmarks - ☐
keel doc- generate documentation - ☐
keel publish- publish to registry - ☐ Package registry (web service)
- ☐ Dependency resolution algorithm
- ☐ Lock file for reproducible builds
- ☐ Private package support
6.2 Distribution
0/6 (0%)- ☐ Nix flake for builds
- ☐ Pre-built binaries
- ☐ Docker images
- ☐ Homebrew formula
- ☐ APT/RPM packages
- ☐ cargo install support
6.3 Community Infrastructure
1/7 (14%)- ☑ Official website (keel-web, built with Leptos)
- ☐ Playground (web-based REPL)
- ☐ Tutorial and guides
- ☐ Example projects
- ☐ Contributing guidelines
- ☐ Issue templates
- ☐ CI/CD pipelines
Priority Order
- ~~**Garbage Collection
- ~~**Std.List
- ~~**Std.String
- ~~**Std.Math
- ~~**Std.IO
- ~~**Std.Http
- ~~**Std.Json
- ~~**Std.Result & Std.Maybe
- ~~**Dataframes