Sigil 0.24.13

release

A build performance and correctness release. sigil run now reuses the bytecode it compiled last time instead of compiling every module again, and it always runs your current sources, even after a sigil build. define-values, let-values and let*-values accept every R7RS formals form, and $ CMD out: FILE in (sigil shell) writes binary output byte for byte. Packages with native C code build much faster, and string comparisons are up to 12 times faster.

Download 0.24.13Get started

Compatibility. The native ABI remains at 10. A few procedures behave differently: any and every return the predicate's value instead of #t, glob now matches directories, and a spec keyword entry that names no keyword parameter is an error. If your code relies on the old behavior, see the last section below.

sigil run reuses its work and runs what you just edited

sigil run used to compile every module, including the standard library, on every run. Now a second sigil run compiles nothing! It also always runs the code you just edited: after a sigil build, it used to launch the bundle that build left behind, so your changes did nothing until the next sigil build. A project with native modules and no bundle-name: now works under sigil run too.

sigil test takes spec checks from the selected config, as sigil build and sigil run do, so an ambient SIGIL_CHECKS=1 no longer turns on checks your config leaves off.

Bind multiple values with any R7RS formals

define-values, let-values and let*-values accept the same formals as lambda. In a dotted list such as (a . rest), the last variable gets the remaining values as a list, and a single variable gets all of them:

(define-values (first . rest) (values 1 2 3))  ; rest is (2 3)
(let-values ((all (values 1 2))) all)         ; => (1 2)

define-values also binds every value; with five or more variables it used to bind only the first four. A value count that doesn't fit the formals is an error, and define-values with two or more variables now works at the top level of a script.

Async tasks can suspend inside all three forms, for example on a channel-receive in the producer, and resume with the right values. On the bytecode VM that used to stop the process with an error guard couldn't catch.

Write binary output from $ to files

In (sigil shell), $ CMD out: FILE and $ CMD err: FILE write the command's bytes unchanged. They used to capture the output as text, remove ANSI escapes and write the result once the command finished, which changed arbitrary bytes: a 2,000,000-byte prefix of an executable landed as 3,662,654 bytes. Now the child process writes the file directly, as > and 2> do in a shell, and err: 'merge keeps both streams in the order they were written. A sink in a missing directory raises before the command runs.

Faster builds for packages with native code

Packages with a native-init initializer spent most of their build in the registration scan, which reads each C unit's preprocessed code to find the modules it registers. The scan now keeps a short summary of each unit, runs in worker processes alongside the C compiles, and reuses the scan of a cached object whose inputs haven't changed. A cold bundle of sigil-cli also spends 7.1 s instead of 66.4 s working out each module's compiler inputs.

Faster string comparisons

string<?, string<=?, string>? and string>=? compare natively, by UTF-8 bytes, which is Unicode code point order. On a release build, a million two-string comparisons take 0.17 s instead of 2.0 s. Sorting 60,000 paths with list-sort string<? takes 0.5 s instead of 2.0 s, and glob over 60,000 files takes 2.1 s instead of 4.1 s.

Other fixes

The full list is in CHANGELOG.md.

Behavior changes