Repository navigation
Releases
sysl 0.13.2
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
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 aBuf'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
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
stringhanded to anexternparameter marked@keepscarries 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
stringtype is unchanged; reference/strings.md describes the form. - Form on:
.bytesof 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.bytesnever changes the view, and two.bytesof one short string are two addresses.--explain-escapesnames the copy. - Form on: under
@no_alloc, returning or storing a.bytesthat 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 andstr_vieware never short and pass. With the form off this compiles as before. - Form on: a raw pointer into
s.bytesthat 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 aBuf[u8]you own, or usec"…". With the form off no org package needs a change. - Form on: an
externtaking 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]makesG3(5)aG[3],type BI = Bx[long]makesBI(5)aBx[long](it was aBx[int]), and a generic alias of a struct is a constructor too (PA(5),PA[int](6)).val g: G[4] = G3(5)andBI(5)where aBx[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 * 2is refused at compile time, andh(Half * 2)picks its overload ash(200 * 2)does. - A comparison chain whose middle operand is an unparenthesised
&,|or^is refused, sinceboolnow has those operators (see Features). - A generic's length and type parameters are symbols in its own declaration.
Box[T]whereBox[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
externnaming an AES, SHA-3 or dot-product LLVM instruction takes and returns vectors, as the instruction does. load_relaxedandSeqLock[T]accept aPlainTwith no zero value, and the codec decodes an array of such elements. Avarof a type with no zero value inside a generic instance is reported at the caller's line, naming the instance.Regexgains two private fields, so aRegexcannot be built by a literal outside its module.- A
@no_allocrefusal 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
&Tnothing keeps past its frame, including a factory's answer kept locally, now lives in the frame; destructors run exactly as before.
Features
boolhas&,|,^,&=,|=and^=, without short-circuit.slot_empty()gives an empty local (var out: T = slot_empty()) for a type with no zero value.Carrying: everyuNhasadd_carryandsub_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,getauxvalon Linux and Android, cpuid on x86-64) to guard an@uncheckedfast path. A name that is not an@extensionsname 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
@extensionsand@unchecked. The x86-64 ones are built, not run. @views(self)members taking*selfreadself.bytesin place, with no copy, short or long;Searchuses it (view_in_place), sos.index_of(…)ands.starts_with(…)allocate nothing.sysl testhonours--explain-escapesand--explain-borrows, and--explain-borrowsnow reports locals, calls through trait objects and closures, and functions answered through function values.sysl import-creads a C string macro as ac const … at string, and refuses a wide literal and a non-literalcharpointer by name.- A generic alias of a struct constructs, and an
if constover 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-borrowssays which and why. AWFY List went from 49.7 ms to 11.6 ms per iteration. - Growth moves instead of copying. A
Bufthat grows with one holder is onememmoveand 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
DisplayandDebugoutput 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 ...
sysl 0.12.1
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.joinanswers any value. 0.12.0 refused a scoped thread whose closure answered a value that is notShare(astring, aBuf, a&T, a struct orOptionholding one). Such an answer is now moved out by the firstjoin, since the ended thread's slot is its one owner; joining the same handle a second time stops the program with a message. AShareanswer 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. NowBuf[N]andBuf[M]are two types there, and a value argument computed over the parameters is compared as a polynomial (N + MisM + N,2 * NisN + 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>, orbuild_jobsin a manifest'stestblock, bounds how many of the test build's compiles run at once, separately from how many tests run at once.--build-jobs 1compiles one piece after another, the slowest build that holds the least memory;--build-jobs 4suits a 16 GB machine. Without either, the settled--jobsbounds the build as before.SYSL_TIMINGS=1now 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, asomeresult) 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
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 hooksysl_trap(kind, a, b, length, at)before it traps. Contract failures no longer reach asysl_bounds_failoverride, as they did on 0.11.10–0.11.15: overridesysl_trapinstead.sysl_bounds_failkeeps its forms, and its default hands on tosysl_trap. - A panic aborts.
panic,assert,assert_eq,unwrap,expectand the library's own panics write their report on stderr, tellsysl_trap, and callabortinstead ofexit(1), in executables andbuild-clibraries alike, so a C host'satexithandlers no longer run. On a freestanding target a panic still writes throughputcharand callsexit(1). - A
newtype does not multiply or divide by itself. The product or quotient of two of its values is a different quantity, soa * banda / bare refused, namingimpl 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
&syncmay not be held across a call that can reachsysl.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
@scopedparameter, by value when kept. Before, a later statement (a second keeping call, adefer, an assignment ofNone) 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-escapesnow 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)andg(K)withconst K = 3120overu32/u64are ambiguous, asg(3120)is, instead of picking the narrowest type; an operator's right operand and a new type's ownFrom[int]follow the same rule. Writeu32(K)to choose. Option[&T]andOption[&sync T]are one address,Nonebeing null.Option[*T]keeps its tag (Some(null)stays distinct fromNone), and is refused in anexternor@exportsignature: a nullable C pointer is a*Tcompared with null. AnexterntakingOption[&T]receives the same address a bare&Thands over.- libm functions need libc.
sin,atan2,pow,cbrt,fmodand the special functions are@needs(libc), so a freestanding program reaching one is refused at the call unless its manifest grantslibc(build-cthen linksm), instead of handed an archive whose link fails. - An executable seals its own functions.
sysl build,sysl runand 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 moduleasm, so LLVM can inline a function called once.emit-llvm,build-libandbuild-care unchanged. sysl test --filebuilds only the@testsfiles it names and what they need. An error in an unnamed, unneeded@testsfile is no longer reported by such a run.SYSL_TEST_EVERY_FILE=1restores the whole build.
Added
- Language
- Trait objects answer
is[T]()andas[T](), a checked downcast over the identity an object carries (asanswers a counted&T, or anOption[*T]on a*Trait), and===/!==compare two objects by identity. - Patterns and operators reach through a reference: a shape matched through
&Ttakes the referent apart, anda + bon&Toperands 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
intand ausizemeet 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)withx: f32). - Function types may name their parameters (
Fn(count: int),*extern(fd: i32)), ignored by type identity; a function type with no->yieldsunit. - A destructor may take
*self:Dropdeclaresdrop(*self)and the hook hands it the payload's own address. - A struct invariant clause may carry a message, reported when it fails.
volatile Tunder anIntegerbound,[]Twidens 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
sqrtof a constant correctly rounded, and reads a reference's referent in a constant pattern.
- Trait objects answer
- Attributes and the C boundary
build-c --shared: a self-contained.dylib/.soexporting only the@exportsymbols. 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()andsysl.raw.from_raw(p): a counted reference given up as a*Tand adopted back.@abandonson an extern that answers a value (lua_call), and@abandons *externfunction pointers, for C catch points.@link(framework: "Name")for macOS frameworks, refused on targets without them.- A
c constline may read a C string, as astring(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)andsysl stack: a bound on a call tree's stack depth, checked on the optimized text.@reassociateon a function, method or block, and@no_fuse, a body or module whose multiplies are never fused with the adds they feed.- Inline
asmtakes a vector register class (vreg) andinoutoperands, 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-wiseexpandtanhover<N>f32and<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_extandmod_inverse, with AArch64 limb kernels.sysl.checksum:crc32c(the instruction where the target has it, slice-by-8 elsewhere) andhash64(rapidhash V3).sysl.sync:SeqLock[T]andload_relaxed/store_relaxed, word-wise relaxed copies of plain data.sysl.text:is_utf8andvalidate_utf8, non-allocating;sysl.unicode.simple_fold.sysl.fs:sync_data,full_sync,open_uncached, and a writable shared mapping withmsync.sysl.net:send_vectored,no_delay,reuse_port,keepalive.sysl.io.poll:Poller.fd()andWakeFd.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.slicessum,dotandzeroize;Hashfor slices,Buf,OptionandFrozen,EqforFrozen.- A named heap is told every block's size and alignment on
allocandfree. - A string held by a
&syncobject or a&sync Fnis 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 aBuf's growth moves its elements (onememmovefor elements holding no count) instead of copying them and dropping the old ones. - A closure that does not outlive its captures holds a captured
valaggregate by address instead of copying it. - The byte search,
from_utf8,from_utf8_lossyandrfind_byte_fromgo 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...
sysl 0.11.15
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
scopecall, as the diagnostic says.
Added
- A
@uniquetype may have aDrop. 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 thedefers), 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@consumesmember owns its receiver and drops it, and the caller of an@abandonsfunction 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@consumesmember taking*self, a value over 128 bytes, anasyncfunction or a closure handed one, one held inside a library type (Option,Buf, …), and an@abandonsfunction'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 toscope,scope_inor wrappers of them may still borrow the frame that wrote them. reference/memory.md has a new example. - Taking a tuple of
@uniquevalues 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
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 testof 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 ownsysl 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
reftaken 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, arefbound to it, a nested function), and for module storage, owning fields past the root, and aBuf'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
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)overf32/f128overloads, andk(a, 2.0 * 3)with anf32a, used to pickf32by widening, whileq(2.0)was already ambiguous. Both are now refused as ambiguous, the same as the bare literal (reference/declarations.md). uniqueis now a built-in attribute, so a user annotation struct nameduniqueis 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 testuses 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=1reports each phase's memory. Program output is unchanged: emit-llvm text is byte-identical. Measured on the compiler's ownsysl 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 oneStrBuilder, so their cost is linear in the output.SYSL_COUNT_BYTES=1makes a counted program print the total bytes it asked the heap for at exit.
Added
- Fallible allocation.
Buf,StrBuilderand the box gaintry_twins of every allocating member, answeringResult[_, AllocError](sysl.alloc), so a program can handle a refused allocation instead of trapping. - Frame limits.
--frame-limit <bytes>onbuild,run,test,build-libandbuild-c, a manifest's top-levelframe_limitkey, 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. @uniqueabove astructorenummakes its values move-only. A use after a move is refused, and@consumesmembers take their receiver. A@uniquetype cannot have aDropyet; 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 implementsIndexPlaceused to readt[i]throughindex_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/Ordkeep a small frame at -O0 (a large enum'sdebug: 4128 → 816 bytes). - A
matchon 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
@guardspage 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
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 constreads a whole number exactly at its C type's own width: u64 max,__int128and_BitIntare 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 silentlyUINT64_MAX.
Fixed
- B25, B26 and B27: a literal, a literal's arithmetic and a measured
c typenow choose between an associated function's overloads and an operator's implementations by the same rule as between functions.B.of(1234567890123)overlong/ulongoverloads is no longer refused, an operator's literal right operand is no longer read atintbefore the implementation is chosen,f(60 * 52)overlong/ulongis no longer ambiguous, and ac typeoverunsigned longis theulongit was measured as. - A module-level vector
valover 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.textis no longer refused when a ref or pointer into aBuf[u8]is live across it.- The type-arithmetic diagnostic names the length as written and the value parameter.
Documented
- A trap inside an
@exportfunction 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
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_fpgeneric 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-borrowsnotes and@disjoint/@reads/@writesrefusals 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@uncheckedform'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.