Appendix B
Standard Library and Packages
The Standard Library
The standard library is the package scaly. Every
program sees all of it without a use — it is the
prelude — unless it is compiled with --no-prelude.
Its modules:
scaly.memoryThe region runtime: pages, regions, the frame pages the compiler gives every routine that allocates, and the traps a program raises on a bounds violation, a null unwrap or a lack of memory.
scaly.containersStringandStringBuilder;Slice[T], the borrowed view that never owns;Vector[T]of a fixed length,Array[T]that grows,List[T];HashMap[K, V]andHashSet[T]with their builders;Option[T](writtenT?) andResult[T, E]. Indexing with[]traps outside the bounds,get(i)answers an Option, andput(i, v)writes.scaly.fiberFibers, the scheduler and the evented I/O beneath the operating-system module, the task pool a self-scaling
forruns on, threads and channels.scaly.osConsole,File,Directory,PathandTcp, and the process environment.scaly.clusterChannels between processes over TCP: a region sent to another node moves with its whole object graph.
scaly.tensorA tape for reverse-mode differentiation — matrix products, activations, attention, the optimizers — living in one region per tape.
scaly.operationandscaly.logicThe protocol that gives the operators their binding strength (Expressions), generated from the levels of the grammar, and
andandoronbool, whose right operand islazy.
Packages Beside It
These packages come with the toolchain. A program declares the
ones it uses (package json 0.2.0, see
Modules and Packages), so a program that never speaks TLS does not
link OpenSSL:
http,https,h3An HTTP/1.1 and HTTP/2 server with a router, static files, WebSocket and gRPC; the same server over TLS 1.3; and HTTP/3 over QUIC (ngtcp2).
tlsTLS 1.3 for a TCP stream, bound to OpenSSL, and the hashes and key derivations a protocol above it needs.
jsonRFC 8259 JSON: a pull reader, a value tree built on it, and a writer.
compressgzip for HTTP bodies, over libdeflate.
pg,redis,sqlite,tdsClients of PostgreSQL (protocol version 3, SCRAM authentication, prepared statements, a pool), Redis (RESP2), SQLite (its own library) and Microsoft SQL Server (TDS 7.4).
scalygpuA tensor tape resident on the GPU (Metal).