Feature Checklist
Implemented Features
Core Language:
- Comments (single-line
//, multi-line/* */, doc///and//!) - One statement per line in a body; no terminator
- Refusal of bidirectional control characters in comments and strings
- A nesting depth limit
- Visibility modifiers (
pub) - Use statements (Rust-style imports with
::and{})
Type System:
- Primitive types (
String,I32,I64,F32,F64,Boolean,Never) foryields a lazySeq<T>, consumed exactly once by a terminal combinator- Array types (
[Type]) - Dictionary types (
[KeyType: ValueType]) - Optional types (
Type?) - Tuple types (named-only)
- Generic types (
Type<T>,Type<T: Constraint>) - Closure types (
(T) -> U,(T, U) -> V,() -> T) - Type inference
Definitions:
- Struct definitions (with field defaults)
- Inherent impl blocks (methods, and static methods without
self, called asType.method(...)) - Trait definitions (field requirements and method signatures)
impl Trait for Typeconformance blocks- Enum definitions (with associated data, generics)
extern fndeclarations (with"C"/"system"ABI selection)extern implblocks (includingextern impl String,extern impl I32, etc. on primitive receivers)- Function definitions with optional overloading
- Parameter conventions (
mut,sink) on regular and closure params - Default parameter values (
fn f(x: I32 = 0)); arity checks treat defaulted params as optional - Codegen attribute prefixes (
inline,no_inline,cold) - Let bindings (file-level, with
pub,mut) - Generic parameters on structs, traits, enums, functions and methods
Expressions:
- All literals (string, multi-line string, number with suffix, boolean, nil, array, dictionary)
- Literal types from the position (
let x: I64 = 5), with a range check - Unary operators (
-,!) and binary operators (arithmetic, comparison, equality, logical, concatenation) - Field access (including nested)
- Destructuring (arrays, tuples, structs); an enum value is read with
matchorif let - Struct and enum instantiation
- Closure expressions
- Range operator (
..) - Correct operator precedence
Control Flow:
- For expressions over arrays, ranges and sequences, which yield a
lazy
Seq<T> - If expressions (with boolean and optional unwrapping)
- Match expressions (exhaustive pattern matching, positional bindings)
Generics:
- Generic type parameters with constraints
- Generic structs, traits, enums
- Generic methods: a method's own type parameters, inferred from its arguments
- Generic instantiation with type arguments and inference
- Nested generics, generic arity validation
- Monomorphisation pass (
MonomorphisePass) clones definitions per unique argument tuple and devirtualises trait calls on concrete receivers - Cross-module monomorphisation: imported items (functions, impls,
pub
lets, generic types) are inlined into the entry module under qualified names so backends see one self-containedIrModule
Module System:
- Use statements,
pub usere-exports, and module path resolution - Visibility control
- Nested modules (
modblocks)
Validation (semantic analysis):
- Module resolution
- Symbol table building
- Type resolution
- Expression validation
- Trait conformance validation
- Cycle detection
- Function overload resolution by labels, argument count and argument types
- Exclusive access: a
mutorsinkargument shares its value with no other argument of the same call - Sequences: each one consumed exactly once, and never stored
- Private types in public signatures, and private items across modules
- Monomorphisation depth limit (E148)
Source Spans (for tooling / source maps / DWARF):
- Every
IrExpr, definition, andIrBlockStatementcarries anIrSpan { span: Span { start, end }, file: FileId } IrModule.file_tableresolvesFileIdto aPathBuf; cross-module clones have theirFileIds remapped onto the entry module's table
Serde:
- The
serdefeature (off by default): serialize and deserialize forIrModuleand every type in it. The JSON form is not a stable format. - The AST has no serialized form.
#[non_exhaustive]on public enums and structs
Not Yet Implemented
- Incremental compilation (salsa)
- Code formatter
- REPL mode
- Evaluation/expansion stage (runtime)