# Foundation Language Foundation is the programming language for Terminus. It is designed for AI agents to read and modify kernel code within limited context windows. ## Current Verified State - Bootstrap compiler: written in C. - Bootstrap regression suite: 13/13 tests via `cd bootstrap && make test`. - Self-hosting compiler: written in Foundation and proven across three generations. - Standard library: `alloc.f`, `io.f`, `str.f`. ## Language Shape - Every `.f` file is an object. - File-level properties are object state. - Imports are explicit. - Errors are return values. - `loop:` is the only loop construct. - Manual memory is expected. - String literals are pointers to null-terminated bytes, not a high-level string type. ## Spec Ahead Of Implementation Some features are specified but not fully implemented yet: float codegen, array/map/tuple literals, field access, `match` codegen, dynamic `load`, `new` instance dispatch, collection operations, and tuple unpacking. ## Public Markdown - `https://foundation.terminus.worldapi.org/md/foundation.md` ## Agent Rule Use `library.md/foundation.md`, `STATUS.md`, and `VERIFICATION.md` as the source of truth before modifying language/compiler behavior.