Skip to content

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.