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

The SSPUR Handbook

The handbook teaches the language from the start. Read it in order: each page uses only what the pages before it covered.

  1. The Basics: programs, main, bindings, if, tests, and how to run them.
  2. Everyday Types: numbers, strings, lists, options, tuples, refinements and newtypes.
  3. Functions and Lambdas: signatures, examples, method-call syntax, lambdas and block lambdas.
  4. Records and Sum Types: your own data, immutable updates and generic types.
  5. Pattern Matching: match, guards, or-patterns and list patterns, e is p tests and while e is p loops, guard clauses, exhaustiveness and decision tables.
  6. Effects and Errors: effect rows, raise and catch, your own effects and handlers.
  7. Contracts and Tests: pre, post, where, tests, examples, fuzz, verify, filling holes and suggested contracts.
  8. Generics and Traits: type parameters, traits, bounds, operators and derive.
  9. Collections and Pipelines: list methods, maps and sets, loops and ranges.
  10. Concurrency: par, atomics and channels, and the race checks.
  11. Networking: HTTP servers and clients, TLS, configuration and structured logs.
  12. Databases: SQLite with typed rows, parameters, transactions, migrations and servers.
  13. Security and Crypto: password hashing, tokens, MACs, encryption, signatures and secrets.
  14. Files, Compression and CSV: Bytes, gzip and zstd, and CSV with typed records.
  15. Packages: sspur.toml, pub, use and the lock file.
  16. Publishing a package: the registry, versions, scoped names, the checks and sspur publish.

Every code block in the handbook is a file in docs/snippets/handbook/, and every terminal session is run by the test suite against the current compiler. If a page and the compiler disagree, CI fails.

The handbook leaves out the parts most programs don’t need: the sys and bare profiles, GPU kernels, services and C interop. The tutorials cover those, and the full language reference has everything on one page.