Editions
Release v0.4.0
An edition is the version of the language a package is written in. Each package names its edition in its manifest (una.toml for editions 0.1 to 0.3, ita.una from edition 0.4), and a release of the compiler supports a set of editions, so a package keeps its meaning when the compiler is updated.
At v0.4.0, una --version prints:
Output
una 0.4.0
editions: 0.1, 0.2, 0.3, 0.4, 0.5
preview: 0.3, 0.4, 0.5
z3: 5.1.0
development buildThe edition key
From spec/13 §7:
[package], required:name,versionandedition, non-empty strings;editionis"0.1". (v0.2, ADR 0056.)editionis"0.1"or"0.2". The constructs of spec/17, spec/18, spec/19 and spec/20 and the keywords of edition0.2exist only in packages of edition"0.2"and later, and a single file has edition"0.1", unless a manifest above it names another (spec/30, #1175).
What edition 0.2 does not have yet
These are planned or deliberately absent. Using a reserved word gives U0103 (§1.5).
| Area | Status |
|---|---|
Shared and isolated references (shared, iso, weak), cyclic structures |
not in any edition yet; the words are reserved for a later edition; use arenas and indices |
User traits and implementations (trait, impl), laws of constraints |
later; edition 0.2 has Eq, Ord and Integer |
Task values, detached tasks, race, select, timeouts, channels, actors |
in editions 0.2 and 0.3, together is the only concurrency; edition 0.4 (preview) adds started tasks (tasks and start), deadlines (within) and races (first of) (spec/27); select, channels and actors are in no edition |
break, continue, an invariant clause for loops |
not in v0.2 |
| A checked left shift | not in v0.2; use wrapping_shift_left or a multiplication |
| Cross-compilation of native executables | not in v0.2; each host builds for itself |
| Units of measure | edition 0.3 preview (spec/25, ADR 0104) |
Pipeline operator (|>) |
not added; method-call chains already cover this form (ADR 0110) |
| Foreign code and FFI | not permitted in any edition (ADR 0121, rule 17) |
| Quantified laws and property tests | deferred: verification tiers 2 and 3 (spec/12, backlog) |
| Semantic diff | deferred; in no release yet (availability) |
| Cost contracts | a later release, not yet scheduled (backlog) |
External state semantics (idempotency, delivery, observe), durable effect journal |
not in 0.4.0, and no edition plans them yet (ADR 0139, rule 6); observe is only a reserved word |
| Services, data access, infrastructure generation | not in 0.4.0, and no edition plans them yet; edition 0.4 (preview) has HTTP servers only (spec/31) |
| Exceptions, null, inheritance, operator overloading, macros, implicit conversions, global mutable state, ambient authority | never |