Repository navigation
v0.5.5
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.
sendgivesResult[(), NoReceiver], an error once no receiver is left.blockingmarks anextern cfunction 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
terminatesis reported as assumed. - A function with an unproven
ensuresisn'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.Chunkwent past 6 GB; it now takes 113 MB. - Repeated scalar merges went past 5 GB; they now take 111 MB.
verifyon code reading thread-local storage aborted.
- A nine-arm match over
- Proven checks in std's generic functions are left out of the programs that use them (#718). A program inserting into a
SortedSetwent from 150 s to 0.1 s. Contracts written over several lines are matched to their proofs. verifydecodes 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
forpattern that may not match is refused. Coverage is checked past 12 levels (#716).
Front end and desugaring (#716)
- An
extern python/rust/tsdeclaration is stored as declared. Before, a hand-written function shaped like a wrapper was taken as assumed byverify. - Named results respect shadowing. A refined record updated field by field stays one step.
- A comprehension over an iterator where a
Listis 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 ownEqinside 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
Stringfromextern cthat isn't UTF-8 is a fault. std.sqlite reports such text as an error. float_from_bitsgives no infinities. Timed waits use the monotonic clock. Arena tags no longer wrap.- A program's own record named
Taskis no longer treated as a task handle. Before, it crashed and madeverifyhang.
std (#718, #721)
- JSON numbers follow RFC 8259.
normalizekeeps non-ASCII text.- The ORM:
- keeps non-ASCII literals in
CHECKs; - applies
!only to its operand; - handles NULL in
not(); - refuses
Realkeys.
- keeps non-ASCII literals in
- A dependency's
[native]C code is linked. - Derived Python, TypeScript and tool wrappers check
requires. --no-xturns astd.cliflag off.Body.read_line, the Unicode property predicates, andmatches()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.shbuilds compiler/ with the latest release.sync:- fails when git's merge fails;
- writes its renames through the journal.
renamereaches patterns in:=andforand refuses keywords.movetakes 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 provenstill passes 300 s: fuzzing doesn't count work inside built-ins. - A program's own one-parameter
Task[T],Sender[T]orReceiver[T]is refused for now. Recognising the built-ins by their core path is in progress. cli-smt_proves_nested_quantifierskeeps "needs a lemma" under the per-instance encoding.