T currently has an alpha-stage, mode-aware type system. The implementation focuses on typed lambda signatures and strict validation for top-level functions, with broader static typing features planned for later phases.
The typing design in spec_files/typing_system.md sets a
dual goal:
PRs #83 and #84 introduced the first concrete implementation of that plan: typed lambda syntax, generic parameter declarations, and strict-mode validation behavior.
Two checker modes are available:
replstrictt repl defaults to repl mode.t run <file.t> defaults to strict
mode.--mode repl|strict can be used to override
defaults.In strict mode, only top-level lambda
assignments are validated today.
T supports both untyped and typed lambda forms.
Body is any expression.
add = \(x, y) x + y
Return type annotation is included inside the parameter parentheses.
add_int = \(x: Int, y: Int -> Int) (x + y)
Generic type variables must be declared explicitly with
<...>.
id = \<T>(x: T -> T) x
pair = \<A, B>(x: A, y: B -> Tuple[A, B]) [x, y]
IntFloatBoolStringNullList[T]Dict[K, V]Tuple[T1, T2, ...]DataFrame[SchemaLikeType] (parsed as a type argument
shape, not yet enforced semantically)Single uppercase identifiers are interpreted as type variables (for
example T, A, B).
In strict mode, for top-level lambdas assigned with
name = \(...) ..., T validates:
If any rule fails, evaluation is blocked with a type error.
The current implementation is intentionally narrow. The following items from the spec are still future work:
In other words, this is a signature validation layer, not yet a full static typechecker.
repl mode for exploratory work.strict mode (default in run) for
scripts and packages.spec_files/typing_system.md