This document outlines the planned development of the Rust-based Kit compiler. The project is currently in the bootstrapping phase, focusing on a minimal but correct compiler pipeline.
The roadmap is organized into phases, not strict deadlines.
Goal: compile a small but valid subset of Kit to C99 and produce a working binary.
- Grammar definition closely aligned with the original Haskell AST
- Stable AST representation in Rust
Goal: lower a well-defined subset of Kit ("Kit Core") to portable C99.
- Top-level functions
- Local variables (
var) - Primitive types:
-
Int -
Bool -
CString
-
-
ifexpressions / statements -
whileandforloops- Basic implementation
-
for i in X...Y -
kit.iterator
- Function calls
-
return -
includestatements for C headers - Interoperability with C functions (e.g.
printf)
- Generics
- Term rewriting
-
defer - Pattern matching
- Implicits
- Generate valid, readable C99 source code
- Invoke the system C compiler to produce a binary
- Configurable compiler flags and toolchain
- Remove intermediate C files after successful compilation
- Replace panics with meaningful compiler errors
- Add error location information (line and column)
- Show a source code snippet for errors
- Unit testing using examples in
examples/
Goal: improve usability and feedback during compilation.
- Display elapsed compilation time
- Show compilation progress (progress bar or structured stages)
Goal: provide a minimal but practical standard library.
- Use the original Kit stdlib as a starting point, with license and authorship disclaimers
- Provide C interoperability where needed
- Aim for zero-cost abstractions where possible
Goal: make Kit projects ergonomic to build and manage.
- Introduce a Cargo-like workflow for Kit projects
- Support
kit.yamlproject manifests - Documentation generation (inspired by
cargo doc)
More information at https://docs.kitlang.dev/package-management/
Goal: support users and contributors beyond the compiler itself.
- Provide a landing page with examples and documentation (kitlang.dev)
- Compiler-specific documentation (architecture, internals, design decisions; docs.kitlang.dev)
- Blog / news section for project updates (optional, future)
- Set a Kit Style Guide based on stdlib code and Kit repos (optional, future). More information on this at https://docs.kitlang.dev/style-guide/
These features are already implemented:
- Add linking flags for compatibility with C libraries
- Replace compiler panics with structured error messages
- Unit testing via example-based tests
- Display elapsed compilation time during compilation