Skip to content

sysl 0.11.15

Choose a tag to compare

@edadma edadma released this 20 Nov 13:46
· 540 commits to dev since this release

A patch release: a thread started on a scope can no longer borrow a scope body's own storage through a closure or a helper, and a @unique type may now have a destructor.

Install

brew install sysl-lang/tap/sysl

or download sysl-0.11.15-darwin-arm64.tar.gz below and put its bin/ on your PATH; the compiler finds share/sysl/library beside itself.

Behaviour change

  • Code that lent a scope body's own array or local to a thread through a closure the body built, or through a helper handed the scope, compiled on 0.11.14 and is now refused (see the first fix below). Declare the storage before the scope call, as the diagnostic says.

Added

  • A @unique type may have a Drop. Its destructor runs on the value exactly once, where its one owner lets go of it: at the end of the owner's scope (in reverse declaration order, with the defers), when the owner is assigned again, at the end of its statement for a temporary, and at the end of the callee for a parameter it was handed. A local moved on only some paths is dropped by a flag, a @consumes member owns its receiver and drops it, and the caller of an @abandons function drops what it holds before the call. A trap runs nothing. The forms not lowered yet are refused with a sentence naming them: taking a tuple of them apart, a @consumes member taking *self, a value over 128 bytes, an async function or a closure handed one, one held inside a library type (Option, Buf, …), and an @abandons function's parameter holding one.

Fixed

  • A thread started on a scope could borrow a scope body's own array or local through a closure the body built (each(xs, (i) -> s.spawn(…))), or through a helper handed the scope and a body or the view (with(s, (t) -> t.spawn(…))). It compiled and the thread used memory after the body returned. These are now refused with the scope rule's diagnostic. Closures handed to scope, scope_in or wrappers of them may still borrow the frame that wrote them. reference/memory.md has a new example.
  • Taking a tuple of @unique values apart (val (a, b) = (r, s), (a, b) = (b, a)) is refused, as before, but the diagnostic now names what the program wrote and how to write it instead (move each value in a statement of its own), not a compiler-made local called $parts.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 25131 passed, 0 failed, 3 ignored. The stage-3 self check reports identical emit-llvm (2740636 lines).
  • --std: 2100 passed, 0 failed.
  • Consumers on the candidate, all green: terndb 2643, slate 2806, skiff (unit suites and seeded board scenarios), nex 889 across its members, avin 1122, benchtop 2004.