Skip to content

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.