Rethon Language Specification¶
Rethon is a Python-inspired, statically typed, AOT-compiled programming language designed around readability, native performance, memory safety by default, and long-term maintainability.
This site publishes the normative language specification for Rethon. It is intended for language designers, compiler engineers, tooling developers, library authors, educators, and maintainers who need the authoritative source-level contract for the language.
Rethon is not Python-compatible. Python informs the source style and developer experience, while Rethon's semantics are grounded in static typing, value-oriented design, protocols, explicit nullability, memory safety, and native compilation.
Normative status
The specification volumes use normative language. Implementations and tools should treat rules in these documents as authoritative unless a later accepted specification update supersedes them.
Start Reading¶
Specification Volumes¶
The language specification is organized into 20 volumes:
- Language Philosophy
- Lexical Structure
- Type System
- Declarations and Bindings
- Functions
- Structs
- Classes
- Protocols
- Generics
- Modules and Imports
- Enumerations
- Pattern Matching
- Error Handling
- Concurrency and Async
- Collections and Iteration
- Memory Model
- Standard Library
- Foreign Function Interface
- Package and Dependency Management
- Toolchain and Build System
Core Commitments¶
- Python-inspired readability without Python runtime compatibility.
- Static typing with inference used only where it preserves clarity.
- Non-null types by default, with nullable forms represented explicitly.
- Structs as value types and classes as reference types.
- Protocols as the primary mechanism for behavioral contracts.
- Generics as a first-class feature, with protocol-based constraints and specialization where practical.
- Memory safety by default without forcing ordinary code into low-level ownership syntax.
- AOT-oriented compilation through
rethoncand package workflows through RETPAK.