Skip to content

sysl 0.11.13

Choose a tag to compare

@edadma edadma released this 19 Nov 12:21
· 556 commits to dev since this release

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.