Skip to content

Releases

v0.5.8

Choose a tag to compare

@anonx3247 anonx3247 released this 30 Nov 18:34
41d3b74

Since v0.5.7:

  • or and except replace ?? and !! (#795).
  • Packed arrays with views, generic externs, BLAS for products (#784).
  • Constructors the types decide are left out by view and put back by edit (R1–R4, #780).
  • verify keys each method, default method and law of a trait on its own (#790).
  • A recursive function is no longer reported refuted when it isn't (#803).

v0.5.7

Choose a tag to compare

@anonx3247 anonx3247 released this 30 Nov 09:11
e714c8b

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

A fix release for v0.5.6. Upgrade if you use std.web or verify's cache.

Security

  • std.web: another module could build an Element or Attribute directly and render <script>, onclick or a javascript: URL. This came from v0.5.6, where Node became pub. render now checks tag, attribute and event names again, with the tests of TagName, AttrName and EventName. A bad element or attribute renders as nothing, and a URL attribute goes through safe_url (#788).

Verification

  • Extern functions: they are now keyed by their declaration. Before, a TypeScript or Rust m.inc could take a verdict cached for a Python m.inc in another package, and an edited extern declaration kept its old verdict (#791).
  • Checks with no key: a check verify can't key is never cached (#791).
  • std generics: build reads std's proof rows split by implementation, as verify writes them. In v0.5.6, std generics kept their runtime checks, which made sorted collections take linear time per change (#791).
  • strata cache clean --obsolete: it no longer deletes std's library proofs or the tour's cache (#791).

Also

  • Verify's cache keys hold no absolute paths, and implementation methods are checked separately (#775).
  • The four cases that test verify's cache use a cache of their own (#793).

v0.5.6

Choose a tag to compare

@anonx3247 anonx3247 released this 30 Nov 07:42
43b0705

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

A bug-fixing release, plus §7 and §9 of SPEC.md from the lab.

Breaking changes

  • Conversions return Result[_, OutOfRange] instead of failing (#777). std's 116 conversion sites are moved.
  • panic(message) is an obligation verify must prove unreachable (#777). Shifts and rotations are total.
  • std.http's serve takes a Clock. serve_limited also takes ServerLimits: by default 256 connections, 30 s to read a request and 30 s to send a response (#757).
  • A pub definition may name only pub types (#782), and a module shadowing one of core's names gets a warning. Warnings come only from the package's own code (#786).
  • In a contract, the result is it. result is an error (#756).
  • Nesting deeper than 1000 levels is a parse error, not a stack overflow (#779).
  • A root type named like a module is an error (#779).
  • Derived copies end in 8 hex digits instead of a running number (#769).

Verification

  • Fixed proofs of false facts:
    • two traits with the same short name were mixed up;
    • a structural bound was read as a closed record;
    • code points past U+1FFFF were modelled as themselves;
    • a function value given to a builtin wasn't checked against its parameters;
    • a function value that can be given itself was shown to terminate (#747, #774).
  • Compile-time values are keyed by their decoded code, and scratch files by SHA-256 (#747).
  • Now proven where they were unknown:
    • I64 counter loops;
    • a dict's size from the distinct keys a goal names;
    • members of a refined set;
    • lists built by push;
    • what any arm of a race gives (#747, #757, #774).
  • verify --termination on markdown.* takes 2 s, not 95 s (#772).

Checker and front end

  • Contracts are type-checked in the function's scope, and trait contracts and provided bodies too (#756). So ensures n == "x" on an Int is an error.
  • One type-table builder replaces nine (#756).
  • Union coverage tells Option[Int] and Option[Float] apart, and integer patterns work past 2^62 (#756).
  • Core's names are matched by full path in handlers, faults, error labels, std.ffi and capabilities (#748, #776).
  • A spawn inside a written map lambda in a scope is refused; comprehensions that spawn still run (#776).
  • Use before import is an error (#761).
  • Columns count characters after strings, doc lines keep their indentation, and comptime is folded in contracts (#761).
  • view of deep code takes memory linear in its size: 70 MB at 300 levels, against 2 GB (#779).

Codegen, runtime and std

  • Fixed crashes:
    • a union value inside a tuple, set or dict at the end of main;
    • a concrete mut trait parameter (now a compile error, ISSUES.md 31);
    • a nested comprehension over an iterator past 5 GB (#757, #776).
  • Fixed leaks: trait default methods without written types, and strata_host_run's arguments (#757, #776).
  • §9 concurrency (#771):
    • resources carry a duty to close;
    • select send arms bind a Result;
    • adds Reply and std.actor;
    • task stacks;
    • six listener leaks fixed.
  • std.toml skips a byte-order mark (#757).

Tools

  • verify checks every selector given (#769).
  • --help works on every command, and init --help no longer makes a package (#769).
  • The skill text is built from strata help (#769).
  • The merge driver keeps the bytes of definitions it doesn't change (#769).
  • docs/std is regenerated (#769).
  • A fault while the runtime holds a lock ends the process instead of hanging (#769).
  • Editors know blocking and noalloc (#769).

Known

  • std.web.Html can be built around its name checks again: std.web.Node became pub in #782 (BUGS.md, std). A fix needs a way for a pub type to keep its contents private.
  • The runtime is macOS arm64 only.

v0.5.5

Choose a tag to compare

@anonx3247 anonx3247 released this 29 Nov 15:35
620b9f7

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

This release changes the stored format. An extern c function can be marked blocking, stored as a new function flag. Files with blocking can't be read by 0.5.4 or older. The format version stays 1. std marks its SQLite, Python, Rust and TypeScript worker calls blocking, so 0.5.4 can't read those std modules.

Green tasks

Tasks are coroutines on a few pinned carrier threads instead of one OS thread each (#725, from #709 and #714).

  • Memory per idle task is 17 KB, down from 64 KB, and 100,000 idle tasks run. Before, about 4,090 could run.
  • The std.http server with 1,000 connections serves 49.1k requests a second, against 15.3k. p50 latency is 0.45 ms against 4.6 ms, and peak memory is 29 MB against 151 MB.
  • It reached 58,500 open connections at 47.3k requests a second. The system's file limit stopped it there.
  • I/O parks the task on kqueue, and tasks get time slices.
  • There is no global lock: each channel, each carrier and each run has its own.
  • A deadlock report says what each task waits on.
  • In a test, the order tasks run in comes from a seed, so it can be replayed.
  • send gives Result[(), NoReceiver], an error once no receiver is left.
  • blocking marks an extern c function that may wait. A task's call to it runs on a helper thread while the task is parked.

Left: the runtime is macOS arm64 only, so Linux needs epoll, and x86-64 isn't done. blocking takes at most 8 integer and 8 float arguments. Cancelling a blocking call is an idea, not built.

Verification

  • Proofs rest only on what is shown (#719):
    • A recursive function is unfolded only when it's shown to end.
    • A lemma resting on terminates is reported as assumed.
    • A function with an unproven ensures isn't treated as one that can't fail.
    • Argument refinements are checked with the call's arguments.
    • A function value stored in a refined record field is checked where it's stored.
  • Crashes and blowups fixed (#712):
    • A nine-arm match over std.agent.Chunk went past 6 GB; it now takes 113 MB.
    • Repeated scalar merges went past 5 GB; they now take 111 MB.
    • verify on code reading thread-local storage aborted.
  • Proven checks in std's generic functions are left out of the programs that use them (#718). A program inserting into a SortedSet went from 150 s to 0.1 s. Contracts written over several lines are matched to their proofs.
  • verify decodes each module file once when building its cache keys. A cached run on compiler/ went from 12.3 s to 8.9 s. Termination's loop searches run together (#724).

Type checker

  • Every definition is keyed by its full path (#720):
    • Traits, methods and bounds from two modules with the same short name are told apart.
    • A bound's type arguments are compared.
    • Capabilities with their own methods are checked.
    • Errors use full names.
  • A for pattern that may not match is refused. Coverage is checked past 12 levels (#716).

Front end and desugaring (#716)

  • An extern python/rust/ts declaration is stored as declared. Before, a hand-written function shaped like a wrapper was taken as assumed by verify.
  • Named results respect shadowing. A refined record updated field by field stays one step.
  • A comprehension over an iterator where a List is wanted is converted.
  • Printing is no longer exponential in nesting depth: 30 levels went from 27 s to 0.04 s.

Code generation and runtime (#713, #722, #723)

  • == uses a type's own Eq inside lists, tuples, options and dicts.
  • Refinements inside a generic type's arguments are checked at run time.
  • A list of a union's member is converted to a list of the union.
  • A String from extern c that isn't UTF-8 is a fault. std.sqlite reports such text as an error.
  • float_from_bits gives no infinities. Timed waits use the monotonic clock. Arena tags no longer wrap.
  • A program's own record named Task is no longer treated as a task handle. Before, it crashed and made verify hang.

std (#718, #721)

  • JSON numbers follow RFC 8259.
  • normalize keeps non-ASCII text.
  • The ORM:
    • keeps non-ASCII literals in CHECKs;
    • applies ! only to its operand;
    • handles NULL in not();
    • refuses Real keys.
  • A dependency's [native] C code is linked.
  • Derived Python, TypeScript and tool wrappers check requires.
  • --no-x turns a std.cli flag off.
  • Body.read_line, the Unicode property predicates, and matches() with a literal pattern are fast. A literal pattern's DFA is built while compiling.

Tools (#717)

  • The shipped std library is used only while std's sources match it.
  • tools/seed-check.sh builds compiler/ with the latest release.
  • sync:
    • fails when git's merge fails;
    • writes its renames through the journal.
  • rename reaches patterns in := and for and refuses keywords.
  • move takes a type's impls and derives along.
  • Two dependencies with the same name are refused, and parallel git fetches no longer race.
  • Unknown long options are refused.
  • Commit trailers come from the git setting strata.trailer.

Known issues

See BUGS.md. Among them:

  • Whole-std verify --require proven still passes 300 s: fuzzing doesn't count work inside built-ins.
  • A program's own one-parameter Task[T], Sender[T] or Receiver[T] is refused for now. Recognising the built-ins by their core path is in progress.
  • cli-smt_proves_nested_quantifiers keeps "needs a lemma" under the per-instance encoding.

v0.5.4

Choose a tag to compare

@anonx3247 anonx3247 released this 28 Nov 18:10
6dc856e

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

The stored format is unchanged from 0.5.3. This release is the second wave of BUGS.md fixes: 70 entries closed (302 → 232).

Data loss and safety

  • Each change's module files and its log entry are written through a journal, so a crash leaves both or neither. Commits take only what changed. Exit codes report failures (#701).
  • Crossed task handles are freed. Host text (paths, arguments, environment, input) is checked for UTF-8 and NUL. read_all returns a Result instead of a truncated string (#700).
  • std: http, web, json, sqlite, orm, process and agent fixes. Repeated headers, HEAD, path decoding, client targets, javascript: and <script> in html, JSON depth, CRLF, large integers, sqlite foreign keys and TEXT, and exit codes (#697).

Verification

  • The verify cache is keyed by the encoding settings. A trait method called through a generic bound ([T: Div]) is no longer proven past the impl's requires. ensures it == e no longer replaces the body. ForPat arms, loop havoc through mut, termination through fields, and build and verify agreeing on what is proven (#699).

Type checker

  • Bounds are checked on every trait. Pending obligations on generic and compound types are kept. Coverage holds past guards and nesting depth. Contracts are typed, and variance is inferred per type. Union fields, mut through std calls, and spawn inside lambdas are fixed (#704).

Code generation and runtime

  • Unions with members of the same head, call results stored into unions, big-integer ranges, float and big-integer keys, ! conversion, Ok(()), _ arms, Type.method, and SortedDict equality (#702).
  • Channel fixes, per-thread free lists, code points on bad UTF-8, floats shown and parsed without the locale, and float % (#700).

Front end

  • "\r", round-trip fixes, refutable := refused, definitions given twice, and comment placement in linear time (#703).

Tools

  • std.process.run_bytes gives a program's output as bytes. history and revert read git blobs through it (#705).
  • Cases fixed on main: merge-file renames, literal checks, verify's new verdicts (#707). Two cases still fail under load or on main (BUGS.md, "Test cases failing on main").

Known issues

See BUGS.md: 232 open entries.

v0.5.3

Choose a tag to compare

@anonx3247 anonx3247 released this 28 Nov 14:07
cdbcbea

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

The stored format is unchanged from 0.5.2. This release fixes data loss in the tools, memory safety in the runtime, and places where verify or the type checker said "yes" without showing it.

Tools: data loss

  • abort checks every saved file before it writes, keeps pending.json when a file can't be put back, and treats a malformed pending.json as an error everywhere. Before, a pending.json with no file list made abort delete main.strata (#685).
  • A change whose log entry can't be written is undone: edit, rename, move, fix and done put the files back and exit non-zero (#685).
  • upgrade finds std and core through STRATA_HOME and encodes every file before replacing any. pack no longer writes over module files or package folders (#685).
  • rename, move, fix, fix --file, revert, resolve and --file PKG/mod.strata edit check the result first and write all their files or none. resolve takes several files at once, so two conflicted files in one package can be resolved (#688).
  • holeify matches by full name: a change to shop.get no longer turns a local get or std.list.get into a hole (#688).

Runtime: memory safety

  • String functions stay inside the string on bytes that aren't valid UTF-8 (#686).
  • A task handle sent out of its scope can be awaited after the scope ends. join is serialised (#686).
  • extern c string arguments are freed only after the result is read (#686).
  • read_file reports a read error as an FsError instead of returning a cut-off string (#686).
  • Int.div and Int.rem require a nonzero divisor, and hash_slot and stack_leave are proven total (#686).

Verification

  • No default yes (#690):
    • Two different function values are different values.
    • A lambda passed for a refined result is checked against it.
    • Termination uses only the facts known before the recursive call.
    • A cached proof doesn't skip the lemma termination check.
    • Assumed clauses match on their whole text.
    • Two sites with the same text no longer share a verdict.
    • The cache keys on what the file holds, not on its header.
    • a.div(b) checks the implementation's requires.
  • Per-instance facts about list elements: proofs that #677 lost are won back, including facts about one range used at a list position and all facts whose element fact is an any (#691, #694, #695).
  • A structural record's refined fields are assumed and checked. Sums over lists are bounded. Generic types' methods and capability functions with assumed contracts pass --require proven (#689).

Type checker

  • Coverage is checked for sum matches on locals, fields and nested patterns. Patterns with a wrong literal type or an unknown field are errors (#692).
  • Impl method signatures are compared with the trait's (#692).
  • The checker now reports these (#692):
    • closure and extern c calls with the wrong arity;
    • wrong mut markers on method arguments;
    • calls of deleted functions;
    • patterns naming removed variants.

Code generation

  • a + b on lists extends a's buffer when no other list uses those slots, so growing a list by concatenation is linear (#693).

Known issues

  • See BUGS.md. Among them:
    • cli-smt_proves_nested_quantifiers still fails under the per-instance encoding;
    • verify's cache doesn't key on STRATA_QUANTIFIERS;
    • a division through a generic [T: Div] call is still proven;
    • a crash between writing module files and the log entry can leave them apart.

v0.5.2

Choose a tag to compare

@anonx3247 anonx3247 released this 28 Nov 07:40
6a6ece1

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

The stored format is unchanged from 0.5.1. This release is the lab's phase 0: soundness fixes, data-loss fixes, and answers that say "no" or "unknown" where they used to say "yes".

Verification

  • Facts about every element of a list are stated at each element the code reads, with no forall (#677). If an obligation stays open because of one, the verdict says "needs a lemma" instead of guessing. The old encoding is behind STRATA_QUANTIFIERS=forall.
  • Termination answers "unknown" for unknown iterators, fuel that ran out, own-method calls and recursion through function values (#627). #646 wins back the verdicts that can be shown.
  • Verify's cache keys include impl methods, own methods, refinement predicates, bounds (#629), and the bodies a proof unfolds (#663). Before, a changed body could leave its callers "proven (cached)".
  • Proven checks are removed per site, not by check name (#633).
  • More obligations: partial operations inside a function's own contract (#656), refinements nested in types, let annotations and function values in contracts (#670).
  • verify builds its inputs only from what the selection reaches (#667). --smt and --obligations show the checks it makes (#637).
  • Datatypes z3 rejected before are accepted (#650, #660, #636).

Type checker

  • Type comparisons answer no or unknown, never a default yes (#628, #632, #652). Scoped narrowing, typed matches, generic aliases and tuple arity are checked (#645). Unions with type-parameter members are fixed (#671).
  • Private records are closed and private functions hidden outside their module (#649).

Tools

  • build refuses a program that doesn't check, with --no-verify too (#675). --ignore-check-errors builds anyway.
  • Three data-loss fixes (#626): an undecodable module is no longer treated as empty, view → edit keeps proofs, and renaming a trait method renames only that trait's.
  • strata new MODULE "DOC" (#625, #641).
  • diff and tour compare definitions node by node; --lines for the line view (#630).
  • check counts and names every open hole, merge conflicts included (#668).
  • strata lint --claims flags comments that state facts about the code (#622).
  • edit on a package folder checks only what it can affect (#657).

Runtime and std

  • Two use-after-frees fixed: an arena across the last task's end, and a channel a task dropped unclosed (#621).
  • A task frees its captures when it ends (#664): the std.http server's peak memory went from 3.99 GB to 80 MB in a 2000-request test.
  • std.http survives failed accepts and handler panics, and refuses requests with both transfer-encoding and content-length (#623).
  • unique and escape analysis: method calls' mut arguments, impl methods, and memory verdicts won back (#635, #647, #654, #662, #669).

Known issues

  • See BUGS.md: 27 entries were added by #676 for things found and not yet fixed.

v0.5.1

Choose a tag to compare

@anonx3247 anonx3247 released this 27 Nov 05:27
f951fd6

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 diff and strata merge-file pair 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/Set literals and loop are stored as the core forms they stand for and shown back as written. Field defaults and T { ..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 + b is stored as Add.add(a, b). A type gets an operator by implementing Add, Sub, Mul, Div, Rem, Neg, Eq or Ord (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.agent didn't round-trip: each store added a std.agent. to a mixed union's member types.
  • merge-file merges 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:at for xs[i], with #617's hygienic desugaring): a local or a function may be named at, 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 }).

v0.5.0

Choose a tag to compare

@anonx3247 anonx3247 released this 27 Nov 01:38
5f039e0

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

Language and std

  • Real (#575): exact rationals, the type of decimal literals (0.1 + 0.2 == 0.3); JSON and TOML numbers are Real.
  • Structural records (#570): { id: OrderId, .. } as a parameter's type or a bound.
  • JSX-like pages (#577): markup in Strata code, stored as std.web calls.
  • std.net, HTTP/1.1 with TLS, std.agent (#574): TCP, HTTP clients and servers, HTTPS clients, streamed bodies; an LLM agent loop with tools.
  • extern rust and extern ts (#576); wasm32 target and derive TypeScript (#601).
  • Tasks get copies, no atomic counts (#564); narrowing from what a function ensures of its result's variant (#567).

Tools

  • strata run --live (#572): edits that check and verify are swapped into a running program.
  • Tree diff and three-way merge (#569): node by node, conflicts as holes; strata history / strata revert (#590).
  • check keeps verdicts per definition (#578); a failed edit writes nothing, edit --as-given writes it anyway (#592).

Verification

  • verify never runs code that reaches an extern (#602) or gives a real capability (#597); faster batches (#598, #599, #604, #606, #610); a type holding a Real is refined by its other parts (#612). std is proven except std.orm.Schema.create and std.orm.Key.load.

Memory

  • Statement regions were tried and removed (#568, #596); memory profiles of five programs (#594); fixes in codegen (#609, #611, #614).

Known issues

  • build-jit-tests: strata test examples/tasks no longer prints the warning for a Result thrown away in memory.queue_after.
  • A rare "dup of a freed object" in check mode (STRATA_MEMORY=check) under strata run with tasks (seen in build-supervised, build-io-cancel).

All merged pull requests since v0.4.0

  • #615 strata --version: 0.5.0
  • #574 std.net, HTTP/1.1 with TLS and streamed bodies, and std.agent (streaming, derive AsTool)
  • #601 wasm32 target and derive TypeScript: Strata called from TypeScript through WebAssembly
  • #576 extern rust and extern ts: Rust through a cargo-built library, TypeScript through a Node worker, values as JSON
  • #612 verify: a type holding a Real is refined only by its other parts
  • #614 codegen: an element store is in place with a variable named at in scope
  • #611 codegen: a record a closure or task captures is not on the stack (the build-tasks freed-object flake)
  • #575 Real: exact rationals, the type of decimal literals
  • #610 smt: a list's known all named once as a predicate of the position
  • #570 Structural records: { id: OrderId, .. } as a parameter's type or a bound
  • #609 codegen, unique: a mut variable read by another argument keeps its own slot
  • #606 verify: VerifyOptions + verify_options parse the flags; verify_program runs the pipeline in named phases
  • #605 site: Vercel deploys only by hand
  • #577 JSX-like pages: markup in Strata code, stored as std.web calls
  • #594 Memory profile of five programs: curves and live objects at the peak
  • #603 IDEAS: bugs the lab fleet found and left unfixed
  • #604 smt: assumed validity facts on demand
  • #564 Tasks get copies, no atomic counts
  • #572 strata run --live: live edits of a running program, when they check and verify
  • #602 verify never runs code that reaches an extern
  • #578 check: keep verdicts per definition; uniqueness analysis incremental and parallel
  • #600 Fast string search: contains/index_of/split/replace through memchr (P3)
  • #569 Diff and three-way merge on trees: node by node, conflicts as holes
  • #567 check: what a function ensures of its result's variant narrows its calls
  • #585 roots: values given back as they are stay counted under --regions
  • #599 verify: the batch builder works on facts by id (P5)
  • #598 verify: build each batch once (answers_all and sort_mixes reuse the worker's text)
  • #597 verify never gives a real capability (fuzzing, replays)
  • #596 Remove regions (phase 2a); record the results of scoped allocation
  • #593 verify --timings: per-definition table; the serial batch rebuilds timed (speed P0)
  • #592 edit: --rm looks in its module first; a failed edit writes nothing
  • #590 strata history NAME and strata revert NAME [COMMIT]
  • #588 Turn off the generated state graphs; fix cli-modules_contracts_and_files
  • #587 verify: a query that ran out of time isn't cached as 'gave up'
  • #584 smt: mut lists come back valid; helper calls in proofs equal their bodies; tasks without intro lemmas
  • #586 verify: a pooled Z3 process starts again after a script sets a global parameter
  • #583 smt: the same value is one term; tasks proofs inline again
  • #582 tasks-proofs-8: every definition of examples/tasks proven
  • #580 CLAUDE.md: full bootstrap only for codegen, runtime, core and releases
  • #579 examples/tasks: claim, record, release, expire and run_worker proven (replaces #566)
  • #568 Statement regions (--regions), phase 2a of scoped allocation
  • #565 check: a mut argument fixes a type argument (codegen's _ instances)
  • #563 codegen: dict equality in an instance with unknown type arguments
  • #556 graph: answers cached per function, questions asked in parallel
  • #554 smt: smaller tasks queries (calls compared by names, long terms through a let)
  • #553 Site: front page compares Rust and Strata on one ledger and one order system; FAQ

Strata v0.4.0

Choose a tag to compare

@anonx3247 anonx3247 released this 26 Nov 07:41
f39d0db

Install: curl -fsSL https://strata-lang.dev/install.sh | sh (macOS arm64).

Written proofs

  • lemma, assert … by, calc (#540): a lemma is a function that exists only for verification; verify proves it once, in its own small query, and a call gives its ensures as one fact. A recursive lemma is a proof by induction. assert e by lemma(…) / assert e by { steps } proves e from the steps alone, then adds it as one fact; calc chains prove one step per query. std.lemmas starts with six proven frame lemmas over dicts.
  • Proofs hidden by default (#540): strata view and the editors hide loop invariants, decreases, assert … by, calc and lemmas behind a marker (// ⋯ 2 invariants); --proofs shows them. strata edit from the default view puts hidden proofs back in their place (and says when a place is gone); strata diff reports proof changes apart from code changes.
  • Spec functions (#551): functions used only in contracts and proofs are one symbol in a function's own query (equal arguments give equal results) and are seen through inside lemma and assert … by proofs, so queries stay small.
  • examples/tasks (#551): enqueue is proven (157 checks) with a loop invariant, a frame and 25 proven lemmas, and all three laws are proven, no_double_claim included. claim, record, release, expire and run_worker are still partly fuzzed: their remaining checks need written proofs like enqueue's. The whole package verifies in about 50 s cold.

Verification speed and soundness

  • contracts.* verifies in 9 s instead of over 300 s (#538): a function's own call inside a lambda goes by its contract instead of being unfolded at every element.
  • #551 prover fixes: congruence for contract-only calls, set(xs.map(f)) exact, the same map/push/list literal is one value, batch answers the solver gave up on asked again alone, proof queries hold only their path's conditions.

Memory and speed of compiled programs

  • Static uniqueness (#521): compiler/unique proves which in-place updates find their value held once, and the compiled code leaves those run-time tests out (234 of 347 such sites in the compiler proven; -15% instructions on update-heavy code).
  • Small values in registers (#522): a function returning a tuple, record or sum of up to 4 words returns it in registers, and callers keep it on the stack — no heap object. 30M calls returning a tuple: 30M allocations → 1, 10.7G → 6.5G instructions. strata check of the compiler: 10.5% fewer heap objects, 5% fewer cycles.
  • Memory fixes found by per-site counters (#523): strings grow in place in small blocks, constant list literals are one shared block, for over a non-mut list borrows it, xs = xs[..n] drops the tail in place, temporary iterators move into the loop, accumulated sets passed as mut. strata check of the compiler: -8% instructions.
  • Smaller executables (#537, #539): executables are linked with -dead_strip: hello world 1.64 MB → 55 KB; the compiler, which hosts the JIT, keeps its runtime symbols.
  • A stage-2 miscompilation from small values (a stack-kept call result's fields freed twice) is fixed (#542).
  • Scoped allocation from roots: design and measurement (#545): compiler/roots assigns each allocation a home scope; measured on the compiler, regions would hold 49.5% of objects and remove 42.5% of releases (no generated-code change yet).

Tools

  • strata diff in seconds (#544): versions compared by hash, only what changed written out: one commit of the compiler 39 s / 1.6 GB → 3.2 s / 300 MB.
  • strata tour (#546): a pull request's tour (Markdown with structural diffs embedded) read in the terminal. Tours show each page's structural diffs (#550).
  • strata view in reading order (#547): imports, then types, then functions, each caller above what it uses; only the rendering changes.
  • Site: About page and tour slides on contracts over behaviour (#548).
  • A test case viewing the wrong copy of core fixed (#541).

Known

  • examples/tasks: claim, record, release, expire and run_worker are not fully proven yet (a full proof of claim exists but its queries exceed the memory limit; smaller per-element facts are the next step).
  • strata diff --graph over examples/tasks against an older version exceeds 300 s.