Skip to content

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.