Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Libraries

Standard library

LibraryContents
(snail-core base)Forms, numeric classes, Option, Result, Pair, lists, vectors, arrays, strings, Show.
(snail-core io)The console and fs effects: text output, lines of input, and files as text or bytes.
(snail-core task)One-shot local dispatch, cooperative yield and timer waits through the runtime-owned tasks effect.
(snail-core table)Immutable tables from strings to values.
(snail-core math)Elementary functions on F64.
(snail-core text)Unicode character properties, case mapping and decimal digit values, from the runtime’s tables. (scheme runtime) is built on it, so Scheme’s character procedures are Unicode’s.
(snail-core random)A deterministic generator as a value.
(snail-core wire)Serialize, Deserialize and the byte encoding.
(snail-core app)Applications, frames, pictures, materials and sprites, and the screen effect.
(snail-core wasm)Loading WebAssembly modules while a program runs, and unsafe-cast.
(snail-core sprite)Spritebooks: animations on sheets of equal cells, posed as sprites facing the camera.
(snail-core format)Indenting and formatting Lisp source as scripts/format-scheme does.
(snail-core integer), (snail-core rational), (snail-core number)Exact integers of any size, rationals, and Scheme numbers.
(snail-core datum), (snail-core read), (snail-core write)Scheme data and its external representation.
(snail-core syntax)The syntax a generate-library recipe returns, and the bytes its producer writes.
(snail-core explore)Bounded model checking of a total state machine’s invariant.
(scheme base)R7RS names (cons, car, vector, char=? …) over the typed language.
(scheme compiler), (scheme runtime)The R7RS translator, and the standard procedures its output calls.

Wire types

(deriving Serialize Deserialize) at the end of a struct or enum generates instances of (snail-core wire)’s classes. serialize writes a value as bytes and deserialize reads it back:

(struct Point
  ((x I64)
   (y I64))
  (deriving Serialize Deserialize))

(ann (deserialize (serialize (Point 1 2))) Point)

Each struct and enum case has a 32-bit TypeId hashed from its library, name and field schema. Every struct or enum value is written as its case’s TypeId followed by its fields, so reading data written for another schema fails at the first changed type instead of misreading it.