A semantics reference for the Quoin language, grounded in how the VM actually behaves. Near-term purpose: a record of how to write Quoin correctly so that a reader (human or a fresh tooling session) doesn't have to reverse-engineer the interpreter. Longer-term, this is intended to grow into end-user documentation.
Format. Pedagogical order — read top to bottom to learn the language — but every section opens with a terse Rules box so it also works for lookup. Parts I–V teach the language core; Parts VI–VIII cover networking & the web, the gradual type system, and the tooling; Part IX tours the standard library, and the appendices consolidate the cheat-sheets and gotchas. Method-level reference is kept brief: the API reference is generated — run qn doc, or ask the REPL with $doc Name / $doc Name.selector — rather than duplicated here.
Status: full draft (Parts I–IX + appendices) pending review. Claims are verified against the parser grammar,
src/vm.rs,qnlib/, and the test suite — the surprising ones were confirmed by running the VM directly.
01-foundations.md=, _, splat, namespaced globalsself and .02-blocks-and-control.md.valueif:/else:/whileDo:, truthiness^ vs ^^03-objects.md<-, <--, ->, -->, @var, .metanew/new:{}, the init/init: chain, block scoping corner cases.mix:/can?:, .sealed!/.abstract!04-patterns-and-errors.mdcase — when:do:, the ~ protocol, .bind:throw/catch:, the Error hierarchy05-concurrency-and-iteration.mdFiber.new:, ^>, Generator.from:, external IteratorIterate mixin, each: as the one primitive, custom iterablesTask.spawn:, join/cancel, round-robin at yield boundaries, parking parks the tasksleep:, gather:, timeout:do: (+ onCancel:), joinAll:close, deadlock detectionparallelCollect:, task graphs, WorkerService06-networking-and-web.mduse std:net/* / use std:web/* load (tasks, gather & timeouts: Part V)TcpSocket / TcpListener / TlsSocket, ByteStream / StringStream, write-through vs. bufferedTcpServer — a minimal concurrent TCP server[HTTP] client — verbs, the request builder, bodies & JSON, streaming, redirects[HTTP]Server transport and the [Web]App frameworkhandle:, then served07-types.md^Ret headers, var x: T, nullable T?, generics, Block(args ^Ret)qn check — reading diagnostics; mismatches, compile-time MNU, override covarianceT?, defined? guards, flow-sensitive narrowingof:/ensure:/elementType, combinatorssealed!/abstract!, the sealed built-ins, why devirtualization needs themNameError, Class.exists?:, MNU candidates08-tooling.mdqn, -e, Runtime.arguments, the exit-code contract, environmentqn repl: persistent sessions, editing/completion, the $-commands, ~/.quoinrcqn test: suites & assertions, coverage reports, exit-code gatingqn check: diagnostics without runningqn fmt: the opinionated, self-verifying formatterqn doc: generated docs and the doc-example harness (which checks this book)qn debug: breakpoints, stepping, exception breakpoints, --dapqn highlight: ANSI and HTML rendering09-library-and-reference.mdIterate, strings, numbers, time, data formats, bytes, I/O & streams, OS, ids; the generated API reference (qn doc / REPL $doc)s vs pp, % formatting, %'…%{expr}', ANSI[IO], [/], [Y]use (pkg:)? path, the resolver seam, directory globscore/* prelude, net/, web/; native vs Quoin10-appendices.md