Repository navigation
sysl 0.9.1
sysl 0.9.1 is a patch release on 0.9.0. It makes the standard library's descriptors close themselves, settles a generic result at &T as Rust does, keeps sysl lsp up with typing, and fixes a run of generics, closure and reflection bugs. It adds sysl.io.wait, associated-type requirements, alternatives at a binding and compile-time comparisons through Eq/PartialOrd.
Install
brew install sysl-lang/tap/sysl
or download sysl-0.9.1-darwin-arm64.tar.gz below and put its bin/ on your PATH; the compiler finds share/sysl/library beside itself.
Behaviour changes (read these first)
- A
File,Socket,UdpSocketorUnixListenercloses its descriptor when its last copy is dropped, as in Rust. AFilefirst hands over what it buffered.- A descriptor taken with
fd(), handed to C and kept after the value is dropped is now closed under C's feet. Use the newinto_raw_fd()to take ownership. - A socket's second
closeanswersNotOpenand closes nothing. - On freestanding targets, a program that makes a socket or opens a file is asked for
sysl_net_close/sysl_fs_closeeven if it never callsclose. - Docs: library/fs.md, library/net.md.
- A descriptor taken with
- A generic call whose result is a bare type parameter settles that parameter at
&Twhen it stands at a&Tparameter or binding, as Rust does. It used to settle it atTand box a copy.bump(pick(m))now mutatesm, and a type with aDropis no longer refused there. An argument that settles the parameter still wins. A parameter whose bounds&Tdoes not meet is still read atT. Docs: reference/generics.md.
New
into_raw_fd()onFile,Socket,UdpSocketandUnixListener;fd()on the socket types.sysl.io.wait: a descriptor can be waited on with a time limit.- The calls are
ready(fd, Readable|Writable, timeout), andreadable/writableonFdReaderandFile. - An interrupted wait is retried for the time still owed, and a wait never answers early.
- It works on a terminal on macOS, whose
pollcannot wait on one. - Docs: library/io.md, api/sysl-io-wait.md.
- The calls are
- A requirement may fix an associated type, as Rust's
Iterator<Item = i32>requirement does:trait Doubles: Seq[Item = int].- A
T: Doublesbody readsT::Itemasint. - Every
implof the requiring trait is held to that type. - Two requirements that fix it differently are refused at the trait.
- This was refused before. Docs: reference/traits.md.
- A
- Alternatives at a binding:
val (Ok(x) | Err(x)) = r.- A
val,varorforpattern with|alternatives that together cover the type binds each name from whichever alternative matched, as Rust'sletdoes. - Alternatives that miss a value are refused in a binding's words.
- An unparenthesised
val A(x) | B(x) = vis refused with a hint. - Docs: reference/patterns.md.
- A
- Comparisons through
Eq/PartialOrdrun while compiling:<<=>>===!=through a written or derived impl.- They work in a
const, anif constand aconstfunction's body. - A module
valover one is laid down as data, so it also builds for a freestanding target.
- They work in a
Fixes
sysl lspno longer falls behind while you type. Changes that arrive faster than they can be analysed are coalesced: only each file's latest text is analysed, after 120 ms of quiet input. On avin's 43.7k-line package, diagnostics now arrive 5.6 s after the last of 40 keystrokes typed at 150 ms; before, it was 154 s. Hover and definition always answer for the latest text.sysl lspchecks a standard-library file the waysysl test --stddoes, instead of refusing it for sitting at the project root. A file with no manifest above it, in a directory tree that spells its module's name, is compiled with that tree. Docs: getting-started/cli.md.- A closure handed to a function whose result is kept in a local was laid in the caller's frame and read after the frame was gone. This happened when that function put the closure in a slice literal, a repeat, or a view of an array, for a callee that answers what it reads through the view. syslUI's
centred(button(...))bound by avalsegfaulted tuner's tests. The closure is now boxed on the heap. - Two generic
implblocks over one type whose parameters share a name now keep their own bounds. Before, if the bounds differed only in an associated type they fixed (T: Seq[Item = int]) or asked of (T: Seq[Item: Mul]), the blocks shared one instantiation of the type. One block then lost its bound ('*' needs 'T::Item: Mul'), or a weaker block was accepted on the other's promise. - At a generic's definition, an undefined name is now reported even when it stands beside a name bound by a pattern over a type parameter's value:
m + nope,f(m, nope),m.method(nope),m[nope],if m == nope, and the same in a closure or anisblock. Before, it went unreported unless the generic was called. Calling such a name,m(x), is no longer refused at the definition; the call is judged at each instantiation. - Calling the result of a call that hands back a closure (
m()(4),f()()(1),fs()[0](3)) was refused with'*self' needs a variable, field, or dereference to point at. The temporary is now given a slot, as Rust does. Kind.Traitwas documented but unreachable.View::Kind,View::NameandView::BaseNamenow answer for a trait, whether bare, generic with its arguments, or imported. So doesT::Kindwhere a trait stands in forT, soif const T::Kind == Kind.Traitworks. Layout queries, and a trait used as a layout, stay refused. Docs: reference/reflection.md.- A module-qualified type name answers its type attributes.
geo.Point::Kind,a.b.T::Fields,geo.Pair[int]::Nameand every other::attribute were refused as a value on the left of::; they now answer as the imported spelling does. Docs: reference/attributes.md. - A comparison chain in a
const(1 < 2 <= 2) now folds. - A link through lld that crashed with a signal, because lld and LLVM were different versions, was reported as an opaque linker crash. Now a link killed by a signal, or any failing LTO link, names the lld and LLVM versions and the fix.
Tests
- Full suite,
SYSL_DOCS=1with stage 2, on the release line before the stamp (merge train 142, 36564422): 22889 passed, 1 failed, 3 ignored. The one failure was a fixture intests_odr_os_directory(the hosted C list now includeswait.c), fixed in 1900a44; train 143 (23af5db) re-ran that file: 30 passed, 0 failed. sysl test library --stdon train 142: 1820 passed, 0 failed. On the 0.9.1 stamp over 23af5db, built by the release script: 1820 passed, 0 failed; the stamped tree's stage-2 comparison (tests_self): 3 passed, 0 failed.- The three-stage build agrees (stage 1 and stage 2 emit identical LLVM).
- The org build census was not run for this release: the org is part-way through its sweep for 0.9.0's breaks (
Buf.at/set, floatOrd). Of the consumers, sblas was run on the candidate and passes.