API reference
Library API
These pages are generated from the library’s own doc comments: every declaration, with its signature and nothing else. The written library section is the other half — what each module…
These pages are generated from the library’s own doc comments: every declaration, with its signature and nothing else. The written library section is the other half — what each module is for, why its pieces are shaped as they are, and worked examples you can run. Start there to learn a module; come here when you know what you want and need its exact signature.
Modules
| Module | Summary |
|---|---|
sysl | The core: what every program has without importing anything. |
sysl.alloc | Allocation that may fail, answered rather than trapped. |
sysl.args | How a program’s arguments become a []string, written here because every line of it is ordinary sysl. |
sysl.buf | The growable sequence and the sink built on it. |
sysl.c | The C variadic forms: va_start, va_arg, va_copy and va_end. |
sysl.checksum | Checksums that detect accidental corruption, and a fast hash for tables – nothing an attacker cannot forge. |
sysl.codec | Turning a value into a format and back, written once for every type and every format. |
sysl.container | Five containers, each with a shape a slice and a Buf cannot give you. |
sysl.container.ring | A queue of a fixed capacity, laid over storage the caller supplies, cheap to take from at either end and needing no allocator at all. |
sysl.cpu | Asking the processor a program is running on which instruction-set extensions it has. |
sysl.crypto | Cryptographic hashing: the SHA-2 family, SHA-1 and MD5, HMAC over any of them, and PBKDF2. |
sysl.debug | The error return trace: where a failure was made, and each ? that handed it one frame further up on its way to the code that reported it. |
sysl.dma | Memory a device can reach by address, and the handover that makes it safe to share with one. |
sysl.encoding | Bytes as text and text as bytes: hexadecimal, base64, UUIDs, and fixed-width integers at either byte order. |
sysl.encoding.json | JSON, read and written: a document parsed into a value tree that owns itself, and a value tree written back out compactly or for a person to read. |
sysl.env | Reading the environment a program was started with. |
sysl.env.hosted | |
sysl.env.sys | |
sysl.fenv | The floating-point environment: the rounding mode, the five exception flags, and on Arm the flush-to-zero, default-NaN and alternative half-precision controls and the input-denormal flag. |
sysl.fiber | Stacks of a program’s own, and the switch from one to another: what a runtime builds lightweight threads on, over the operating system’s threads that carry them. |
sysl.fmt | What an f"…" hole’s computed width or precision comes to — ${x}%.${n}f, ${s}%${w}s — and what an integer under a specifier renders as — ${n}%08x. |
sysl.fs | What is at the end of a path: reading and writing whole files, metadata, directories, links, and the errors any of it can answer with. |
sysl.fs.errtext | |
sysl.fs.hosted | |
sysl.fs.sys | |
sysl.fs.watch | Watching files and directories for changes: a Watcher holding any number of watches, whose descriptor is readable while it has something to report, and a read that answers what changed. |
sysl.harness | A test framework that runs on the target. |
sysl.hint | Hints to the optimizer that change what it may assume, never what a program computes. |
sysl.io | The byte surface a program reads through, and the line cursor over it. |
sysl.io.hosted | |
sysl.io.poll | Waiting on many descriptors at once: a set of them registered with the kernel – kqueue on Darwin and the BSDs, epoll on Linux – and one call that answers which are ready. |
sysl.io.sys | |
sysl.io.wait | Waiting for a descriptor with a time limit: whether a read, or a write, would go ahead without waiting, asked of the system and answered before the time runs out. |
sysl.log | Structured logging: a level, a message, a few named fields, and somewhere for them to go. |
sysl.math | Mathematics on the numeric types: the float functions, the integer ones, and the traits that let a program write both at whichever width it is already using. |
sysl.math.bigint | Integers with no width: sign and magnitude, the magnitude a run of machine-word limbs. |
sysl.math.complex | Complex numbers, at whichever floating-point width the program is already using. |
sysl.math.decimal | Exact decimal arithmetic: an integer coefficient and a scale, so 0.1 + 0.2 is 0.3. |
sysl.math.rational | Exact fractions: a numerator and a denominator, both BigInts, so a third is a third. |
sysl.net | Sockets – a TCP stream, a UDP socket, a Unix domain stream – and the names a host resolves to. |
sysl.net.hosted | |
sysl.net.sys | |
sysl.path | Path handling that is decided by the string alone. |
sysl.posix.rand | A seed taken from the host, for a program that wants a different sequence on every run. |
sysl.posix.threads | sysl.threads under the name it had when its threads were pthreads, kept for the programs that import it. |
sysl.posix.time | Reading the two clocks the host keeps, which is the one thing sysl.time deliberately cannot do. |
sysl.posix.tty | Whether escapes should be written at all. |
sysl.process | Starting another program and waiting for what it does. |
sysl.process.hosted | |
sysl.process.sys | |
sysl.rand | Pseudo-random numbers: a named, seedable, reproducible generator, and the distributions that are easy to get wrong. |
sysl.raw | The raw tier’s reinterpreting forms: ptr_cast, str_cast, str_alias, from_raw and nonnull_unchecked (a *T taken as a *nonnull T with nothing checked). |
sysl.reflect | |
sysl.regex | Matching text against a pattern: compile one, then find, replace or split with it. |
sysl.seq | What a sequence of values can be asked, in one trait, so that a slice and a Buf answer the same names. |
sysl.signal | Signals as flags: a program asks to be told that one arrived, and asks again later whether it has. |
sysl.signal.hosted | |
sysl.signal.sys | |
sysl.slices | Operations over a built-in slice, and the pointer a C binding needs to hand one across. |
sysl.softfloat | |
sysl.softfloat.binary64 | |
sysl.softfloat.libm | |
sysl.softint | |
sysl.softint.aeabi | |
sysl.sync | What two threads may touch at once: Atomic[T], SpinLock, SeqLock[T], and the five memory orderings. |
sysl.sys | The platform seam: everything the library asks of what it is hosted on, and nothing else. |
sysl.term | What a terminal understands: the escape sequences that colour text, emphasise it, and move the cursor about. |
sysl.term.edit | Reading a line from a terminal that will not do it for you. |
sysl.term.keys | Keystrokes out of the bytes a terminal sends: the decoder a full-screen program reads its keyboard through. |
sysl.testing | What a test may say about itself while it runs, beyond passing or failing. |
sysl.text | The whole text surface: what a string is made of, and every operation over one. |
sysl.threads | Threads of execution, and the two things a program does with one: start it, and wait for it – with the lock, the condition variable and the channel threads share things through. |
sysl.threads.hosted | |
sysl.threads.sys | |
sysl.time | Points on the timeline, lengths of it, and the calendar that turns one into a date. |
sysl.time.tzif | Reading a zone out of the bytes of a TZif file (RFC 8536), which is what the IANA time zone database is distributed as. |
sysl.tty | A terminal’s mode: line by line or a keystroke at a time, echoing or not, and putting back what was there. |
sysl.tty.hosted | |
sysl.tty.sys | |
sysl.unicode | What the Unicode Character Database says about a character, and the operations over text that only that database can answer. |
sysl.vectors | Lane lists for a vector’s shuffle: the rearrangements SIMD code reaches for, at every width. |