The Korrin language specification
This is the normative description of Korrin: if the implementation disagrees with a statement here, one of them is a bug. It describes the language as of Milestone 1.
Nothing here is speculative — features not yet implemented are not described. Every runnable example is executed by CI against the implementation.
| # | Section |
|---|---|
| 01 | Lexical structure |
| 02 | Grammar |
| 03 | Values and types |
| 04 | Expressions |
| 05 | Statements |
| 06 | Functions |
| 07 | Classes |
| 08 | Built-in functions |
| 09 | Errors and diagnostics |
| 10 | Execution model |
Conventions
-
Grammar fragments use the notation defined in section 02, which also gives the complete grammar.
-
A fenced code block tagged
korrinis an example. Blocks that also carry an expected-output comment are executed by CI (crates/korrin/tests/spec.rs) and must produce exactly that output. The convention:```korrin print(1 + 2) # => 3 ```A
# =>line states the next line of expected standard output. A# error: E0304line states that the program must fail with that code. -
"must", "must not", and "may" are used in the RFC 2119 sense.