v0.8.14 — Bedrock and Maybe
Deep Expression Recursion
The constant folder previously handled top-level binary expressions but left sub-expressions inside function calls, list literals, struct constructors, index expressions, Option/Maybe Some wrappers, Contains checks, and closures untouched. A catch-all _ => expr arm silently passed through 20+ Expr variants without recursing.
v0.8.14 replaces the catch-all with exhaustive matching across all 26 variants. Every sub-expression site — Call args, List elements, New field initializers, Index expressions, OptionSome values, Closure bodies — now gets folded. Given:
## To double (n: Int) -> Int:
Return n * 2.
## Main
Show double(2 + 3).
The 2 + 3 inside the call arguments folds to 5 before codegen, producing double(5) instead of double(2 + 3).
Unreachable-After-Return DCE
Statements following a Return in the same block are dead code. The dead code elimination pass now truncates blocks after the first Return:
## To f () -> Int:
Return 42.
Show "unreachable".
Return 99.
The Show and second Return are eliminated. This also catches returns inlined from constant-folded if true branches. Returns inside nested If blocks do not incorrectly truncate the outer block.
Algebraic Simplification
A new try_simplify_algebraic pass fires when one operand of a binary expression is a known identity or annihilator:
| Pattern | Result |
|---------|--------|
| x + 0, 0 + x | x |
| x * 1, 1 * x | x |
| x * 0, 0 * x | 0 |
| x - 0 | x |
| x / 1 | x |
These rules apply to both integers and floats. The simplification returns the surviving operand directly — no arena allocation needed. Combined with deep expression recursion, double(5 + 0) first recurses into the call argument, then simplifies 5 + 0 to 5, producing double(5).
Maybe Syntax
Maybe is now a first-class alias for Option. Both forms work interchangeably:
Let x: Option of Int be nothing.
Let y: Maybe of Int be nothing.
Let z: Maybe Int be nothing.
The direct form — Maybe Int without the of preposition — follows Haskell convention. It works in all positions: variable annotations, function return types, and nested generics (Maybe List of Int → Option<Vec<i64>>). All seven codegen paths that handle Option now accept Maybe identically.