Repository navigation
v0.5.1
Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).
A new stored format. Every .strata file is re-encoded. A strata older than 0.5.1 can't read these files, and 0.5.1 doesn't read older ones: view old code as text with the strata that wrote it (strata view --proofs), then store it with this one (strata edit).
The stored format
- Stable ids (#559): every definition and variant has a 32-bit id, kept across edits, renames and moves; references in the stored tree are ids, indexes into each file's id table.
strata diffandstrata merge-filepair definitions by id, so a rename on one side is followed by the other side's new uses. Files are about 7% smaller. - The stored tree is the core language (#562): handlers (
x!,x?,except,or,!!,??), ranges, indexing, slices, element assignments, comprehensions,Dict/Setliterals andloopare stored as the core forms they stand for and shown back as written. Field defaults andT { ..r, f: x }are stored as written and lowered when read, so a field a record gains is filled in. A spread is stored written out. - Operators are trait methods (#558):
a + bis stored asAdd.add(a, b). A type gets an operator by implementingAdd,Sub,Mul,Div,Rem,Neg,EqorOrd(core.ops), also across two types (impl Mul[Int, Money] for Money). The compiled code for built-in types is unchanged.
Fixed on the way
std.agentdidn't round-trip: each store added astd.agent.to a mixed union's member types.merge-filemerges a definition node by node again when its sides were stored apart.tools/roundtrip.sh(parse(print(t)) == t) holds on all 146 files of the repository.- Sugar calls the built-ins by names no program can take (
$core:atforxs[i], with #617's hygienic desugaring): a local or a function may be namedat,range,map….
Known issues
- Diagnostics print a checked expression's built-in calls as calls (
range(0, 3),slice(xs, 0, i)), not as the sugar written. - An assertion's message shows a record update lowered (
Point { y: 3, x: p.x }).