Problem
Competing with Rust and C needs types TypeScript doesn't have. Every number is a 64-bit float — the checker's primitive table has one number_t — so AOT code must either box or prove integer ranges. There are no fixed-layout value structs, no sealed classes (any object can gain properties at runtime) and no guarantee an array has no holes. AssemblyScript and Microsoft's Static TypeScript are prior art. This is the "ES2015 moment": evolving JavaScript rather than replacing it, so the RFC should be written as a public proposal. (New direction.)
Evidence (origin/main @ d4b219507)
Scope
- Integer and float types (
i8–i64,u8–u64,f32,f64) as subtypes ofnumber/bigint, with checked or wrapping arithmetic defined explicitly. - Fixed-layout value structs (copy semantics, no prototype mutation) and sealed classes.
- Dense arrays and typed-array-backed
T[]for numeric element types. - How each feature erases to plain JS for the JIT path (so the same source runs everywhere) and what it guarantees under AOT.
- Syntax that stays valid TypeScript where possible (branded types / declaration-file intrinsics) versus new syntax.
- Relationship to TC39 proposals (type annotations, shared structs, records & tuples).
Acceptance criteria
- RFC merged in
docs/and published for outside comment. - Checker prototype: the integer types type-check in sound mode with an
HMdiagnostic for mixing them. - One benchmark kernel rewritten with the new types to show the AOT difference.
Links
Depends on: #782, #784 Related: #800, #812, #818 Part of #814.