Skip to content

Releases

sysl 0.13.2

Choose a tag to compare

@edadma edadma released this 23 Nov 01:12

A patch release with one fix. A frame array of a program-declared type that a view lets out of its frame is now let go of correctly at its scope end; since 0.12.0 it could fault there. Nothing else changes. The short string form stays off by default, as in 0.13.0 and 0.13.1; SYSL_SHORT_STRINGS=1 still turns it on for a build.

Install

brew install sysl-lang/tap/sysl

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

Behaviour changes

None.

Fixed

  • Fixed: a frame array of a program-declared type that a view lets out of its frame (a promoted array) was let go of at its scope end by the element type's compact release, which read the buffer's header as the element and faulted (SIGBUS/SIGSEGV) once the declaration held the last share. This was wrong code since 0.12.0's compact boxes; it crashed 81 of terndb's tests.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 26918 passed, 0 failed, 3 ignored.
  • --std: 2283 passed, 0 failed.
  • The stage-3 self check reports identical emit-llvm.
  • No consumer suites were run for this release.

sysl 0.13.1

Choose a tag to compare

@edadma edadma released this 22 Nov 19:30

A patch release with one fix: the fiber-switch check added in 0.13.0 no longer refuses a view that owns no count, which blocked every avin build. Nothing else changes. The short string form stays off by default, as in 0.13.0; SYSL_SHORT_STRINGS=1 still turns it on for a build.

Install

brew install sysl-lang/tap/sysl

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

Behaviour changes

None.

Fixed

  • The fiber-switch check no longer refuses a view that owns no count lent to a call that can reach sysl.fiber.switch: a literal's bytes, a view of a frame or module array, of a raw pointer, or of a slice parameter (0.13.0 refused these, blocking every avin build). A call's result, a fresh heap string, and a view of a Buf's storage are still refused.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 26912 passed, 0 failed, 3 ignored.
  • --std: 2283 passed, 0 failed.
  • The stage-3 self check reports identical emit-llvm.
  • No consumer suites were run for this release.

sysl 0.13.0

Choose a tag to compare

@edadma edadma released this 22 Nov 16:15

The fastest sysl yet: on Are We Fast Yet it takes 1.23 times as long as C++ (1.52 in 0.12.0), the reference-count work the compiler can prove unnecessary is gone from calls through closures, trait objects and locals, and regex search is about twenty-five times faster. A new short string form, held in the value itself, ships in this release but stays off unless you ask for it. Several changes alter what compiles; they are listed first.

Install

brew install sysl-lang/tap/sysl

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

Behaviour changes

The short string form is opt-in. A string of 15 bytes or fewer (7 on a 32-bit target) can be held in the string value itself, with no allocation. It is not yet faster on every program (the Json benchmark is slower with it on), so it ships off by default; SYSL_SHORT_STRINGS=1 turns it on for a build. With it off, every string is long, byte for byte as before the form existed. Of its seven behaviour changes, one holds in both forms and six only with SYSL_SHORT_STRINGS=1:

  • Both forms: a string handed to an extern parameter marked @keeps carries one count to C, and C hands it back by answering the string. A string C never hands back is held for the rest of the program; a literal needs no count. A string lent to a parameter that is not kept crosses for the call only.
  • Form on: a string of 15 bytes or fewer is held in its own words. The string type is unchanged; reference/strings.md describes the form.
  • Form on: .bytes of a short string is a copy in the frame, copied to the heap once if the view outlives the frame. A write to the variable after taking .bytes never changes the view, and two .bytes of one short string are two addresses. --explain-escapes names the copy.
  • Form on: under @no_alloc, returning or storing a .bytes that may be short is refused ("this view of 's.bytes' is returned, and the string may hold its bytes in itself"). A literal, a cut of a literal and str_view are never short and pass. With the form off this compiles as before.
  • Form on: a raw pointer into s.bytes that would outlive the frame is refused, as is a pointer a C function answers where it may point into a string argument that is returned or stored. Lend it at the call that reads it, copy the bytes into a Buf[u8] you own, or use c"…". With the form off no org package needs a change.
  • Form on: an extern taking a string by value gets a pointer valid for the call, and a C-returned short string is refused at run time.
  • A compiled library records which form it was built with, and a build in the other form refuses it by name instead of linking it. With the default (off) this only matters for a library built with the flag on.
  • Form on: counted-heap and allocation counts are lower (SYSL_COUNT_ALLOCS, SYSL_COUNT_BYTES), which a test that pins an exact count will see.

Behaviour changes in the type checker and the language:

  • A call through a closure or a trait object takes no count where every implementation answers a reference read out of its arguments, in a program's own build (BI8). The program's tables gain one slot after the ordinary ones; libraries, archives and C see unchanged tables. A function whose parameter is passed by address also gets the count-free entry.
  • A struct alias constructs and matches as the struct. type G3 = G[3] makes G3(5) a G[3], type BI = Bx[long] makes BI(5) a Bx[long] (it was a Bx[int]), and a generic alias of a struct is a constructor too (PA(5), PA[int](6)). val g: G[4] = G3(5) and BI(5) where a Bx[int] is wanted are now refused as mismatches; both were wrongly accepted.
  • Untyped integer constant arithmetic is exact, as a literal's is. const Half = 200; val x: u8 = Half * 2 is refused at compile time, and h(Half * 2) picks its overload as h(200 * 2) does.
  • A comparison chain whose middle operand is an unparenthesised &, | or ^ is refused, since bool now has those operators (see Features).
  • A generic's length and type parameters are symbols in its own declaration. Box[T] where Box[U] is declared, and an array length or lane count that differs from the declared one, are refused at the declaration whether or not anything calls it; a closure's result is checked against a declared &Fn. reference/generics.md, vectors.md and arrays.md have the rules.
  • An extern naming an AES, SHA-3 or dot-product LLVM instruction takes and returns vectors, as the instruction does.
  • load_relaxed and SeqLock[T] accept a Plain T with no zero value, and the codec decodes an array of such elements. A var of a type with no zero value inside a generic instance is reported at the caller's line, naming the instance.
  • Regex gains two private fields, so a Regex cannot be built by a literal outside its module.
  • A @no_alloc refusal of an interpolation says "the string a value renders as"; the refusal is the same.
  • Allocation counts change where a box is laid in the frame. A &T nothing keeps past its frame, including a factory's answer kept locally, now lives in the frame; destructors run exactly as before.

Features

  • bool has &, |, ^, &=, |= and ^=, without short-circuit.
  • slot_empty() gives an empty local (var out: T = slot_empty()) for a type with no zero value.
  • Carrying: every uN has add_carry and sub_borrow, lowered to LLVM's overflow intrinsics; bigint's portable loops use them.
  • sysl.cpu: cpu.has("sha3") asks the running processor (sysctl on macOS, getauxval on Linux and Android, cpuid on x86-64) to guard an @unchecked fast path. A name that is not an @extensions name is refused at compile time; a call on a bare-metal target is refused.
  • Crypto and dot-product intrinsics for AArch64 (AES, SHA-3, dot product) and x86-64 (AES-NI, AVX-VNNI) under @extensions and @unchecked. The x86-64 ones are built, not run.
  • @views(self) members taking *self read self.bytes in place, with no copy, short or long; Search uses it (view_in_place), so s.index_of(…) and s.starts_with(…) allocate nothing.
  • sysl test honours --explain-escapes and --explain-borrows, and --explain-borrows now reports locals, calls through trait objects and closures, and functions answered through function values.
  • sysl import-c reads a C string macro as a c const … at string, and refuses a wide literal and a non-literal char pointer by name.
  • A generic alias of a struct constructs, and an if const over an enum value parameter accepts the bare variant (see Fixed).

Performance

  • Are We Fast Yet, against C++ (30 × 10, Apple M5 Pro): sysl is 1.226 times C++ (95% interval 1.223 to 1.229), from 1.521 on 0.12.0. The geometric mean of each language's time relative to C, fastest first: C 1.000, Zig 1.044, C++ 1.116, Rust 1.209, sysl 1.369. Per benchmark against C++: List 4.37 to 1.09, Permute 2.16 to 1.26, Towers 1.88 to 1.15, Queens 1.96 to 1.68, DeltaBlue 1.47, Havlak 1.29, Json 1.30, Richards 1.81, CD 1.70; sysl is faster on Bounce (0.96) and NBody (0.90). Richards, CD, Queens, DeltaBlue and Json are where sysl is still slowest. The full per-benchmark tables against C++, C, Rust and Zig are on the new Performance page and in the README.
  • plb2: sysl is 1.03 times C, with C 1.00, D 1.01, Nim 1.02, Rust 1.04 (over three programs, Rust's bedcov prints a wrong answer) and Swift 1.11. Zig has no cells: upstream's programs do not build on Zig 0.17.1.
  • Json, the short-form regression, is gone. With the form off (the default) Json runs at 175 ms against 0.12.1's 173 ms; the opt-in form-on path improved from 214 ms to 183 ms, because == and substring bounds checks no longer copy the string to the stack.
  • Less reference counting. A local that only walks storage takes no count; an argument handed to a closure or trait-object call takes none when nothing that call can reach writes through it; a rebound or rewritten parameter, a held argument, an unwrapped pair and a call's live kills are all worked out; a reference read out of a field that is written before it is read again is moved out (no count in either direction); a box laid in the frame has its counts elided, including one handed to a trait object or closure. --explain-borrows says which and why. AWFY List went from 49.7 ms to 11.6 ms per iteration.
  • Growth moves instead of copying. A Buf that grows with one holder is one memmove and a count raise, as in C++.
  • A failed bounds check is one call to a cold stub, so small functions inline again.
  • String interpolation builds in one buffer, with up to 64 bytes of Display and Debug output in a frame scratch: one allocation, not one per piece.
  • Regex search uses a lazy DFA forwards and backwards, falling back to the VM only for captures. regex-redux on a 5,000,000-line fasta goes from 33.7 s on 0.12.1 to 1.36 s (PCRE2 with its JIT: 1.59 s, Rust's regex crate: 1.60 s).
  • Emitting a function whose body is one long block is linear instead of quadratic in its length, and inferring which locals need no count no longer slows compilation of large programs.

Fixed

  • A box laid in a frame now tears down as a heap box does: releases inside its destructor wait for the destructor, and a frame box let go of inside a running drain is torn down before its frame ends (this used to fault). A value read through a pointer keeps its count across a call that overwrites module storage holding it. A box whose address is read through a cast to another pointer type stays on the heap, which fixes a leak from viewing a &sync Frozen.
  • A closure laid in the frame and kept by what a call answers (a factory box, a struct returned by value) was torn down at the end of the statement that made it, so a later ...
Read more

sysl 0.12.1

Choose a tag to compare

@edadma edadma released this 21 Nov 12:10

A patch release: building a large tree's tests is faster and holds less memory, with a new --build-jobs bound, regex search is faster, ScopedThread.join answers any value, and a generic's value parameters are checked as symbols in its own declaration. Two changes alter what compiles; they are listed first.

Install

brew install sysl-lang/tap/sysl

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

Behaviour changes

  • ScopedThread.join answers any value. 0.12.0 refused a scoped thread whose closure answered a value that is not Share (a string, a Buf, a &T, a struct or Option holding one). Such an answer is now moved out by the first join, since the ended thread's slot is its one owner; joining the same handle a second time stops the program with a message. A Share answer joined twice answers the same value without waiting again.
  • A value parameter is a symbol inside its own declaration. Before, it stood at a value that took no part in type equality, so cast[const N: usize, const M: usize](b: Buf[N]) -> Buf[M] = b, and an uncalled -> Buf[N] = Buf[N + 1](...), compiled. Now Buf[N] and Buf[M] are two types there, and a value argument computed over the parameters is compared as a polynomial (N + M is M + N, 2 * N is N + N, an exact division by a constant cancels). A mismatch in a result, a local's declared type, an argument or a field is refused at the declaration, whether or not anything calls it, and the message says how the two forms differ. reference/generics.md has the rules and examples.

Improved

  • Building a large tree's tests is faster and holds less memory. The generated test dispatcher was one function with an arm per test (52,000 blocks for the compiler's own suite); its arms are now cut into functions of 256, spread across the codegen units. On the compiler's own test build the longest unit's clang goes from 205 s and 8.1 GB to 73 s and 4.4 GB. Measured with this release's compiler on that build (SYSL_NO_CACHE=1, every one of its 26,416 tests compiled in): the whole build takes 522 s, against 611 s on 0.12.0, and the clangs' whole phase takes 80 s. The largest process peaks at 9.5 GB resident (/usr/bin/time -l), and the compiler holds 4.8 GB as the clangs start.
  • sysl test --build-jobs <n>, or build_jobs in a manifest's test block, bounds how many of the test build's compiles run at once, separately from how many tests run at once. --build-jobs 1 compiles one piece after another, the slowest build that holds the least memory; --build-jobs 4 suits a 16 GB machine. Without either, the settled --jobs bounds the build as before. SYSL_TIMINGS=1 now reports the test build's phases.
  • Regex search skips positions where no match can begin. While no match is under way, a search steps over every character the pattern's first instructions refuse, and every start shares one unset capture array. regex-redux on a 5,000,000-line fasta goes from 56.7 s to 33.7 s with 2.2x less allocation; output is identical.

Fixed

  • A closure type error in a closure passed to a generic library function (spawn, Buf.map) is reported only at your line; the library's own line no longer earns a second, wrong error. An instantiation whose own type arguments were never worked out is the only one kept quiet, so a generic or a property whose result its body settles (= value, a some result) still reports that body's errors instead of reaching clang.

Known issues

  • TernDB's suite still has failures on this release; they are being investigated.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 26404 passed, 4 failed, 5 ignored. All 4 came from one cause, the refused-closure fix above silencing a body that settles its own result. It was corrected, and the four files, three new neighbour tests, 17 generic, closure and inference test files and the pages reference/traits.md, reference/generics.md and library/threads.md then passed (388 tests and three docs sweeps, 0 failed). The stage-3 self check reports identical emit-llvm (2904905 lines).
  • --std: 2258 passed, 0 failed.
  • slate on the candidate: 2806 passed, 0 failed.

sysl 0.12.0

Choose a tag to compare

@edadma edadma released this 20 Nov 22:34

A minor release: every check now reports through one weak sysl_trap hook, references get a null niche in Option, trait objects can be downcast, build-c --shared builds a self-contained dynamic library, and the standard library gains big-integer arithmetic at scale, checksums, vector math and more. Some programs 0.11.15 accepted are now refused; they are listed first.

Install

brew install sysl-lang/tap/sysl

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

Behaviour changes

  • Every failure reports through sysl_trap. Every compiler-inserted check (contracts, within/where, Succ/Pred, division by zero, checked casts, union reads, allocation) writes one line naming the check and its location on stderr, then calls the weak hook sysl_trap(kind, a, b, length, at) before it traps. Contract failures no longer reach a sysl_bounds_fail override, as they did on 0.11.10–0.11.15: override sysl_trap instead. sysl_bounds_fail keeps its forms, and its default hands on to sysl_trap.
  • A panic aborts. panic, assert, assert_eq, unwrap, expect and the library's own panics write their report on stderr, tell sysl_trap, and call abort instead of exit(1), in executables and build-c libraries alike, so a C host's atexit handlers no longer run. On a freestanding target a panic still writes through putchar and calls exit(1).
  • A new type does not multiply or divide by itself. The product or quotient of two of its values is a different quantity, so a * b and a / b are refused, naming impl Mul / impl Div, which make them writable (with any result type). A literal is still a scale (d * 2), and %, + and - are unchanged.
  • A counted value that is not &sync may not be held across a call that can reach sysl.fiber.switch, since the fiber may resume on another thread. Mark a body @pinned(thread) to opt it out, or end the value's scope before the call.
  • A closure's capture mode is decided where the closure is written: by reference when handed to a @scoped parameter, by value when kept. Before, a later statement (a second keeping call, a defer, an assignment of None) could change the same line from a write to a copy. A program that relied on the old by-reference choice is refused by the lost-write rule, which names the mode; --explain-escapes now reports, for every such closure, which way it holds its captures and why.
  • Overloads read literal arithmetic and untyped constants as the literal they stand for. g(60 * 52) and g(K) with const K = 3120 over u32/u64 are ambiguous, as g(3120) is, instead of picking the narrowest type; an operator's right operand and a new type's own From[int] follow the same rule. Write u32(K) to choose.
  • Option[&T] and Option[&sync T] are one address, None being null. Option[*T] keeps its tag (Some(null) stays distinct from None), and is refused in an extern or @export signature: a nullable C pointer is a *T compared with null. An extern taking Option[&T] receives the same address a bare &T hands over.
  • libm functions need libc. sin, atan2, pow, cbrt, fmod and the special functions are @needs(libc), so a freestanding program reaching one is refused at the call unless its manifest grants libc (build-c then links m), instead of handed an archive whose link fails.
  • An executable seals its own functions. sysl build, sysl run and the test binary give every function of the program's own modules internal linkage unless it is an @export, placed in a section, or named by module asm, so LLVM can inline a function called once. emit-llvm, build-lib and build-c are unchanged.
  • sysl test --file builds only the @tests files it names and what they need. An error in an unnamed, unneeded @tests file is no longer reported by such a run. SYSL_TEST_EVERY_FILE=1 restores the whole build.

Added

  • Language
    • Trait objects answer is[T]() and as[T](), a checked downcast over the identity an object carries (as answers a counted &T, or an Option[*T] on a *Trait), and === / !== compare two objects by identity.
    • Patterns and operators reach through a reference: a shape matched through &T takes the referent apart, and a + b on &T operands resolves the referent's operator.
    • t[i, j]: a subscript with several indices, on a container indexed by a tuple or an array.
    • The one-tuple (x,), and written type lists over a pack.
    • impl[const N: usize] Tr for [N]u8: an impl for every array of one element type; an impl may also target a vector (<N>f32, <N>T).
    • A bare enum variant resolves from its own payload's shape, and may share a name with a module value.
    • An int and a usize meet where the value of one is known to fit the other's type.
    • A bare literal beside a typed argument takes the overload that argument matches exactly (nextafter(x, 100.0) with x: f32).
    • Function types may name their parameters (Fn(count: int), *extern(fd: i32)), ignored by type identity; a function type with no -> yields unit.
    • A destructor may take *self: Drop declares drop(*self) and the hook hands it the payload's own address.
    • A struct invariant clause may carry a message, reported when it fails.
    • volatile T under an Integer bound, []T widens to []volatile T, and a volatile-element array fills from a literal.
    • Constant evaluation reads and writes memory as another type (the bytes of its storage in the target's byte order), folds sqrt of a constant correctly rounded, and reads a reference's referent in a constant pattern.
  • Attributes and the C boundary
    • build-c --shared: a self-contained .dylib/.so exporting only the @export symbols. Headers spell *const T, void *, size_t/ptrdiff_t, array parameters and c type names, emit #defines from exported consts and enums, and take --header-guard.
    • r.into_raw() and sysl.raw.from_raw(p): a counted reference given up as a *T and adopted back.
    • @abandons on an extern that answers a value (lua_call), and @abandons *extern function pointers, for C catch points.
    • @link(framework: "Name") for macOS frameworks, refused on targets without them.
    • A c const line may read a C string, as a string (a const holding C's literal) or a *u8 (a val over the c-string literal).
    • @extensions("…"): a function compiled for processor extensions the build does not promise, called from code that has them or inside @unchecked("…").
    • @no_recursion, @stack(n, calls: m) and sysl stack: a bound on a call tree's stack depth, checked on the optimized text.
    • @reassociate on a function, method or block, and @no_fuse, a body or module whose multiplies are never fused with the adds they feed.
    • Inline asm takes a vector register class (vreg) and inout operands, tied in place or into another variable.
  • Vectors
    • <N>U(v) converts lane-wise and <N>T(x) splats a scalar; sqrt, floor, ceil, round, trunc, bits()/from_bits; mask and table operations (m.bits(), table.lookup(idx), v.compress(m), xs.gather(idx)); an integer dot product accumulated in a wider integer; sysl.math.VectorFloat's lane-wise exp and tanh over <N>f32 and <N>f64.
  • Library
    • sysl.math.bigint: Karatsuba, Toom-3 and a number-theoretic-transform multiply and square, recursive division, divide-and-conquer text conversion, Lehmer and half-gcd, gcd_ext and mod_inverse, with AArch64 limb kernels.
    • sysl.checksum: crc32c (the instruction where the target has it, slice-by-8 elsewhere) and hash64 (rapidhash V3).
    • sysl.sync: SeqLock[T] and load_relaxed/store_relaxed, word-wise relaxed copies of plain data.
    • sysl.text: is_utf8 and validate_utf8, non-allocating; sysl.unicode.simple_fold.
    • sysl.fs: sync_data, full_sync, open_uncached, and a writable shared mapping with msync.
    • sysl.net: send_vectored, no_delay, reuse_port, keepalive. sysl.io.poll: Poller.fd() and WakeFd.
    • view_as[T](): a view read at another plain-data element, its owner kept, boundary and tail checked.
    • Buf.swap_remove, aligned[T](n, alignment), sysl.slices sum, dot and zeroize; Hash for slices, Buf, Option and Frozen, Eq for Frozen.
    • A named heap is told every block's size and alignment on alloc and free.
    • A string held by a &sync object or a &sync Fn is shared: copied into bytes with an atomic count where the box is made.

Improved

  • A box whose payload no code reaches without its type holds only its strong count, an object whose box holds nothing dies without the reaper, slot_storage(0) and a run-time [v; n] of zero allocate nothing, and a Buf's growth moves its elements (one memmove for elements holding no count) instead of copying them and dropping the old ones.
  • A closure that does not outlive its captures holds a captured val aggregate by address instead of copying it.
  • The byte search, from_utf8, from_utf8_lossy and rfind_byte_from go sixteen bytes at a time.

Fixed

  • Overflow reports name closure, nested-function and element operands as declared, and a type parameter's by its width.
  • A deref scrutinee matched where a fiber may move binds shares of the referent, not a copy of it.
  • A clause message naming a frame variable is refused as not constant, not as undefined.
  • A box's and a buffer's header pad covers every gap to the payload, computed from the layout's alignment.

Known issues

  • TernDB's suite has failures on 0.12.0 that are still being investigated.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 26322 passed, 46 failed, 5 ignored. All 46 were tests and doc links that had not caught up with this release's changes; they were correct...
Read more

sysl 0.11.15

Choose a tag to compare

@edadma edadma released this 20 Nov 13:46

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.

sysl 0.11.14

Choose a tag to compare

@edadma edadma released this 20 Nov 02:12

A patch release: sysl test of a large tree holds far less memory while compiling, and a ref taken through a parameter or local is no longer refused across a call that writes another value of its type.

Install

brew install sysl-lang/tap/sysl

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

Improved

  • sysl test of a large tree holds far less memory while compiling. The compiler now lets go of what code generation never reads: the field-path analysis, each typed body once it is lowered, and the per-type name sets in the borrowing answers (now one bit per function). It also sizes the module text buffer exactly. Program output is unchanged: emit-llvm text is byte-identical. Measured on the compiler's own sysl test . --file tests_widening.sysl (SYSL_NO_CACHE=1), using this release's compiler: the compiling process peaks at 9.1 GB resident (/usr/bin/time -l), against 16.1 GB on 0.11.13. At the end of code generation it holds 7.6 GB, against 8.0 GB. The memory held as the link's clangs start is unchanged, at 4.9 GB.

Fixed

  • A ref taken through a parameter or a local (ref r = node.inner) is no longer refused across a call that may write another value of the same type. The slot keeps its object alive for the whole call. It is still refused where the body lets the slot's address out (&node, a ref bound to it, a nested function), and for module storage, owning fields past the root, and a Buf's elements. reference/memory.md has a new example.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 25091 passed, 0 failed, 3 ignored. The stage-3 self check reports identical emit-llvm (2727033 lines).
  • --std: 2100 passed, 0 failed.
  • Consumers on the candidate, all green: terndb 2570, slate 2806, skiff (unit suites and seeded board scenarios), nex 865 across its members, avin 1122, benchtop 1960. One avin terminal test (no-terminal read) failed once under load and passed on re-run.

sysl 0.11.13

Choose a tag to compare

@edadma edadma released this 19 Nov 12:21

A patch release: sysl test and large builds use far less memory, allocation can fail without trapping through the new try_ members, a function's stack frame can be limited and reported, and @unique makes a value type move-only.

Install

brew install sysl-lang/tap/sysl

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

Behaviour change

  • Literal arithmetic at an overload tie is ambiguous like the bare literal. q(2.0 * 3) over f32/f128 overloads, and k(a, 2.0 * 3) with an f32 a, used to pick f32 by widening, while q(2.0) was already ambiguous. Both are now refused as ambiguous, the same as the bare literal (reference/declarations.md).
  • unique is now a built-in attribute, so a user annotation struct named unique is refused.
  • A null from the heap now traps before it is stored. The string runtime, the writer buffer and the hand-written task frames used to store a null pointer unchecked.
  • A private[m] or file-private generic method called from outside its reach is now refused. Before, the generic call path skipped the visibility check.

Improved

  • sysl test uses far less memory on large trees. A suite is now compiled by one child process and linked by a fresh one, so the link never runs beside the memory the compile held. Code generation writes each function's text as soon as it is built instead of holding every function's instructions. SYSL_TIMINGS=1 reports each phase's memory. Program output is unchanged: emit-llvm text is byte-identical. Measured on the compiler's own sysl test . --file tests_widening.sysl (SYSL_NO_CACHE=1), using this release's compiler. The compiling process peaks at 16.1 GB resident, against 26.6 GB before. The process that sits beside the link's 16 clangs holds 4.9 GB as they start, against 21.5 GB. In the fix's own measurement, the whole process tree's peak fell from 39.0 GB to 22.8 GB.
  • sysl.regex: replace_all, the listing, a class's rendering and a class name are each gathered in one StrBuilder, so their cost is linear in the output. SYSL_COUNT_BYTES=1 makes a counted program print the total bytes it asked the heap for at exit.

Added

  • Fallible allocation. Buf, StrBuilder and the box gain try_ twins of every allocating member, answering Result[_, AllocError] (sysl.alloc), so a program can handle a refused allocation instead of trapping.
  • Frame limits. --frame-limit <bytes> on build, run, test, build-lib and build-c, a manifest's top-level frame_limit key, and @frame_limit(n) / @frame_limit(none) above a function or method fail the build when a function's stack frame is larger. The error names the function, its frame, the limit and what set it. The nearest setting wins. --stack-usage <file> writes every compiled function's frame, largest first.
  • @unique above a struct or enum makes its values move-only. A use after a move is refused, and @consumes members take their receiver. A @unique type cannot have a Drop yet; value destructors come in a later release.

Fixed

  • A subscript in a generic body calls the member its bound names (B30). An Index-bounded body instantiated at a type that also implements IndexPlace used to read t[i] through index_place.
  • A written type argument on a private generic associated function is kept by itself.
  • A box's header gap is laid as explicit padding, and a box kept off the heap (a module val's static image, a closure's frame slot, a vtable method's slots) sits on its payload's alignment boundary. Before, an @align(64) payload's static box sat on 16.
  • Derived Debug/Display/Eq/Hash/Ord keep a small frame at -O0 (a large enum's debug: 4128 → 816 bytes).
  • A match on a large enum read through its address reads the tag as one word, instead of carrying the whole enum as one LLVM value.
  • A match through a large local moves a returned payload straight out of it again, without an extra copy.
  • The @guards page says what it checks: a private field, and members trusted to take the lock.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 25062 passed, 3 failed, 3 ignored. The three failures were fixed before the tag, and those files and the match-emission files were rerun on the release commit: 198 passed, 0 failed. The stage-3 self check reports identical emit-llvm (2725572 lines).
  • --std: 2100 passed, 0 failed.
  • Consumers on the candidate, all green: slate 2806, skiff (unit suites and seeded board scenarios), nex 865 across its members, avin 991, benchtop 1960, terndb 2521. slate and avin were rerun green on the release commit.

sysl 0.11.12

Choose a tag to compare

@edadma edadma released this 18 Nov 01:19

A patch release: a c const is read exactly at its C type's own width, literals choose between a type's overloads and operators the way they choose between functions, and a module-level vector val builds on freestanding targets.

Install

brew install sysl-lang/tap/sysl

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

Behaviour change

  • c const reads a whole number exactly at its C type's own width: u64 max, __int128 and _BitInt are read exact. A value that the declared sysl type cannot hold is now refused instead of being read wrong. That includes a negative C value read into an unsigned type, which was silently UINT64_MAX.

Fixed

  • B25, B26 and B27: a literal, a literal's arithmetic and a measured c type now choose between an associated function's overloads and an operator's implementations by the same rule as between functions. B.of(1234567890123) over long/ulong overloads is no longer refused, an operator's literal right operand is no longer read at int before the implementation is chosen, f(60 * 52) over long/ulong is no longer ambiguous, and a c type over unsigned long is the ulong it was measured as.
  • A module-level vector val over constants (a literal, a splat, the operators, a shuffle, a select, a conversion) is laid down as static data, alone or inside a struct, an array or an enum payload, so a freestanding build that reads one is no longer refused.
  • ByteSink.text is no longer refused when a ref or pointer into a Buf[u8] is live across it.
  • The type-arithmetic diagnostic names the length as written and the value parameter.

Documented

  • A trap inside an @export function ends the process with the trap signal and never unwinds or returns into C (reference/ffi.md).

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 24929 passed, 1 failed, 3 ignored. The failure is the stage-2 whole-tree comparison timing out at 300 s on a loaded machine; the release script's stage-3 comparison is the self check that counts.
  • --std: 2100 passed, 0 failed.
  • Consumers on the candidate, all green: slate 2806, skiff 332 (and 15 board-image checks), nex 865 across its four members, avin 980, benchtop 1960.

sysl 0.11.11

Choose a tag to compare

@edadma edadma released this 17 Nov 19:15

A patch release: a failed struct invariant now names the clause that broke, and a generic function's diagnostics and strict floating point now match a plain function's.

Install

brew install sysl-lang/tap/sysl

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

Behaviour change

  • A struct invariant that fails now names the clause that broke and where it is written: invariant of 'Window' failed: clause 'lo <= hi' at main.sysl:4:15 (main.sysl:8:1). A constant whose value breaks an invariant names the clause the same way. The clauses are still checked in written order, the first broken one is named, and the exit status is still the trap's.

Fixed

  • Inside a @strict_fp generic function, a closure written above the function's last statement was compiled with ordinary floating-point arithmetic instead of the strict form.
  • A generic function's diagnostics pointed at its last statement instead of the function: --explain-borrows notes and @disjoint/@reads/@writes refusals now point where they do for a plain function, and an error trace names a closure inside a generic made real once (wrap.int.<closure>). An @unchecked form's diagnostics now cover the whole word.

Tests

  • Full suite on the release tree (SYSL_DOCS=1, stage 2): 24875 passed, 1 failed, 3 ignored. The failure is the stage-2 whole-tree comparison timing out at 300 s on a loaded machine; the release script's stage-3 comparison is the self check that counts.
  • --std: 2100 passed, 0 failed.
  • Consumers on the candidate, all green: slate 2806, skiff 299 (and 14 board-image checks), nex 871 across its four members, avin 979, benchtop 1934.