Repository navigation
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.