Compatibility (M9)
Trine 1.0 makes one promise: a program that works keeps working, and keeps meaning the same thing. This page says exactly what that covers.
What is stable
| promise | |
|---|---|
| the language | SPEC.md 1.0: every program it accepts keeps being accepted and keeps its behavior, per edition |
| definition hashes | a definition's hash (HASHING.md) never changes for the same definition: stores, trine semdiff, rename hints and trine.lock keep working across versions |
| built-in functions and library names | none is removed or changes meaning; new ones may be added (a program's own definition of a name always wins) |
| the command line | the commands and flags in CLI.md marked stable |
--json diagnostics | the shape (AGENTS.md) and the error codes; new codes may appear |
trine.toml, trine.lock, .trine/ | read by every later version |
| capabilities and grants | a program never gets authority it didn't have; grant flags keep their meaning |
What is not
- Message wording. Errors and warnings get clearer; match on
code, not text. - Performance, the IR, the generated C, and the output of the internal commands (
ir,rc,bounds,tokens,fuzz,hintstext). - Bugs. Where the implementation and SPEC.md disagree, the implementation is fixed, even if a program relied on the bug (the fix is called out in the release notes).
- Experimental features named as such in their docs.
Editions
A breaking change to how source is read can only come with a new edition (SPEC.md §6):
- a package opts in with
edition = "..."intrine.toml(trine newwrites the latest); without one a file is read as0.9, so code from before editions compiles unchanged; - every compiler from 1.0 on compiles every edition, and packages of different editions are used together (an edition changes how a file is read, never what a definition means: hashes are the same in every edition);
- every edition comes with
trine migrate, which rewrites a package and proves the rewrite changed no meaning (every definition hashes the same afterwards, under its old name or its new one) before writing anything.
| edition | what changed | migration |
|---|---|---|
0.9 | (the language before 1.0) | |
1.0 | async, await, test, unsafe are reserved words | renames those names (test → test_) |
Versions
The compiler follows semantic versioning from 1.0.0: a minor release (1.1, 1.2) adds and never breaks a program that works; a patch release (1.0.1) fixes bugs. A 2.0 isn't planned: breaking changes to how source is read come as editions instead, which every 1.x compiler keeps compiling. trine version prints the compiler's version, the language version and the editions it knows. Release notes: CHANGELOG.md.
Deprecation
Something that will go away in a new edition first gets a trine lint warning, for at least one release, and the warning names the replacement. Nothing is removed from an existing edition.
Kept honest by tests
tests/compat/0.9/: the examples and the tour as written against 0.9, with what they printed and their definitions' hashes, plus programs using the 1.0 reserved words as names and a package without an edition. Every build checks they still compile, print the same and hash the same, and thattrine migratemoves them to 1.0 without changing either.spec_lists_every_keyword_and_builtin: the spec names every keyword and built-in.cli_and_error_codes_are_documented: every command intrine's usage is in CLI.md and the other way round, and every diagnostic code is in AGENTS.md.