Decision index¶
The project was renamed postc → postpile on 2026-08-05 (the executable is
ppc), and the pygo repository was merged in aspygo/the same day. The ADRs are records: those written before that date say "postc" and reach pygo by its old sibling path in prose, and they stay as written; only their relative links were repointed.
The decisions are grouped by what they decide. Sixteen numbers are retired (0008, 0009, 0012, 0013, 0017, 0018, 0034, 0036, 0037, 0046–0052): the 2026-08-07 consolidation merged each episode-series into one remaining ADR, whose preamble names the absorbed numbers, and removed the retired ADRs. A number, once assigned, is never reused. The originals, play-by-play included, live in git (tag adr-pre-cleanup) and in notes/; ../../../notes/accept-then-wrong.md lists what the decisions got wrong on the way in.
How to read a status. Draft: proposed and waiting on the owner; it decides nothing until it loses the word. (blank) or extends: the decision stands as written. Amended by: a later ADR changed part of it; both preambles say so. Consolidates NNNN: this ADR absorbed those retired numbers.
The shape of the compiler¶
| 0000 | Build postc on previous work | |
| 0001 | The QBE backend; float ** through a runtime helper no optimizer rewrites |
amended by 0055 |
| 0002 | Debug, release and unchecked build modes | amended by 0022, 0053, 0055, 0062, 0075 and 0079 |
| 0003 | Whole-script compilation: implicit main, print, the stdout differential, programs of several files |
|
| 0014 | An IR verifier, and guards that point at builds instead of output | amended by 0015, 0021, 0024, 0033, 0055 and 0070 |
| 0021 | IR05 was one invariant wearing two backends' clothes | amends 0014; amended by 0033 |
| 0033 | Definite assignment: a read that cannot be proven bound is a checked read; del of a local |
amends 0007, 0014 and 0021; decides A99, A146 |
| 0054 | The IR declared once, and def-use derived from it | feeds 0014; 0033 asks it where a name binds |
| 0055 | The frontend records the counted loop; QBE stops matching its shape | amends 0001, 0002 and 0014 |
| 0074 | The frontend's lowering domains are objects the lifter holds, not mixins over a stubbed base | |
| 0079 | WebAssembly is the C backend's output compiled for wasm32-wasip1 (--target), a WASI command or reactor; its oracle is CPython built for WebAssembly; JavaScript is a second foreign host on Pyodide's names (js, JsProxy), with Pyodide as its oracle; the WebAssembly-text backend retired |
amends 0002 and 0070; related to 0006 |
Values and the type surface¶
| 0004 | CPython-exact scalar formatting; an int never enters a float slot implicitly |
amended by 0025, 0027 and 0039; decides A142, A190 |
| 0005 | The scalar builtin-function surface; CPython's exceptions where CPython raises | amended by 0020 and 0075 |
| 0015 | bytes values, counted and headered like a Str |
amends 0014; decides A174 |
| 0020 | int ** int is an int; a negative exponent is rejected |
amends 0005; amended by 0075; decides A11 |
| 0062 | Bitwise operators: CPython's values, a shift of its left operand's type, << overflowing as * does, ~ refused on unsigned |
amends 0002; amended by 0075 |
| 0025 | The Str representation: the negative-offset header, one allocator, adoption |
amends 0004; ownership in 0026 |
| 0029 | Closed tagged unions, with match as the eliminator |
builds A79, A150, A154; amended by 0065 (several classes as one case) and 0066 (the representation of an optional) |
| 0066 | An optional of a pointer type is a pointer that may be null | decides A164; amends 0029 |
| 0070 | Functions as values, without capture: a Callable parameter, local or return holds a function's address and is called through it; a lambda bound to an annotated name is a nested def |
decides A184; amends 0014; amended by 0076 and 0079 |
| 0076 | Closures: a function value as a counted object holding its captures, a cell for a name written with nonlocal or rebound after the def, a list element |
amends 0070 and 0010; decides A196 |
| 0075 | One int in both modes, growing past 64 bits as CPython's does, after range proofs that discharge the overflow checks on bounded operands; growth is an executable's default; int and Int64 are two types |
amends 0002, 0005, 0007, 0020 and 0062; decides A189, A191, A193 |
| 0077 | One range for every list[int] element of an executable, built from the stores the typed lowering records and proven by the syntax pass's fixed point, then used by a second lowering |
amends 0075 |
Containers¶
| 0027 | list[T], and why the language has two container types; every list method, xs += v in place |
amends 0004; amended by 0024, 0030, 0053 and 0068 |
| 0028 | The aggregate surface: is_aggregate, printing and a container's text, comprehensions, reducers with key= and reduce, constructor spellings |
consolidates 0047 and 0039's genexp half (2026-08-07); decides A159 |
| 0030 | dict and set, and why only one matches CPython's order |
amends 0007 and 0027; amended by 0058, 0071 and 0073; decides A83, A179, A183 |
| 0071 | collections.defaultdict: the default is the runtime dict's, consulted by d[k] on a miss; builtin int, float, bool and str factories |
amends 0030 |
| 0073 | A dict's values may be lists and sets: a value position dtype per member type, two ownership codes in the map runtime; a deep copy copies a dict's values | decides A188; amends 0030 |
| 0031 | The empty container, and why it is one rule for three types; a member type from the first use | decides A86 and A147, closes A4 |
| 0057 | Lists of lists: a row is a list element with its own count; a list of lists compares and sorts; a list of sets | extends 0027; the cascade and cycle grounds of 0024 do not apply |
| 0064 | Generators consumed in place: the body written into the loop that consumes a call; a generator expression held in a name for the next statement | decides A162; amends the spec's §5.2; amended by 0072 |
| 0072 | Generators as state machines: a call the inlining cannot take, recursive or held in a name, makes a frame its consumer resumes | decides A187; amends 0064 |
Classes and memory¶
| 0023 | Class instances: layout, fields typed as mypy types them, methods, @staticmethod, @classmethod, @dataclass, __slots__, the refusal boundary |
amended by 0024, 0032, 0040, 0042 and 0063; decides A149, A172 |
| 0024 | The heap memory model: slots, the descriptor, the destruction queue, cycles, the instrument | consolidates 0034, 0036, 0037 (2026-08-07); amends 0014, 0023 and 0027; amended by 0065 and 0078 |
| 0026 | The ownership discipline for Str: copy-on-send, the exception record, the C ABI |
extends 0024; amended by 0007; representation in 0025 |
| 0078 | A loop variable borrows the element, with no count, when three things hold: the walked list or set is held; nothing the loop runs (by a call-graph summary) drops an element of that type; the variable is a plain local read only in the body | amends 0024 |
| 0032 | Single inheritance, by monomorphising the receiver | amends 0023; amended by 0065 |
| 0065 | Values of several classes: a base-typed value holding a subclass, a union naming several classes, a method dispatching on the instance's class | decides A161; amends 0024, 0029, 0032, 0035 and 0042 |
| 0035 | One descriptor per class, and the union-typed field | the layout detail behind 0024; amended by 0065 |
| 0038 | x is None as a tag test, and narrowing where the type checkers narrow: guard clauses, assert, and/or, conditional expressions, joins, and fields |
decides A153, A163; extends 0029; leaves 0023's refusal of is untouched, a different question with the same operator |
| 0039 | The format mini-language subset, and printf-style % formatting |
amends 0004; its genexp half moved to 0028 |
| 0040 | __repr__ and the positions that dispatch to it; the default repr shows this runtime's address |
amends 0023; amended by 0063; decides A179's repr |
| 0063 | Operators on instances: the special methods for operators, indexing, equality, ordering and hashing; no reflected methods | decides A167, A168; amends 0023, 0040 |
| 0041 | Dtype equality is not type equality for parameterised types | the field rung it emerged from lives in 0024 |
| 0042 | Read-only class attributes, and isinstance, callable, issubclass and type(x) as compile-time constants |
amends 0023; amended by 0065, which gave instances their class |
| 0043 | The str method surface: three semantic domains, encode/decode, the word walk of for w in s.split(): |
consolidates 0052 (2026-08-07); amended by 0069 |
| 0069 | A split word used only as a dict key is looked up by its span of the string, made only to be inserted, and bound to the name when the loop ends | amends 0043 |
| 0044 | Slicing, with CPython's adjustment and shared slots | extends 0043, 0027 |
| 0045 | Tuples: value-free forms, one representation per name, the synthesized heap class, returns in the per-task slots | consolidates 0046, 0048, 0049, 0050 (2026-08-07); amended by 0058 |
| 0058 | Tuples as values: a pack built where a value is needed, nested tuples, returned tuples holding anything, tuples as keys, tuple[T, ...] as an immutable list |
amends 0030 and 0045; decides A151, A173 |
| 0053 | Proven-bounds list loops: the provably dead IndexError elided, raw accessors called, companion lists included | amends 0002 and 0027; amended by 0068 |
| 0056 | An extension module exports its public functions: scalars, str and Array[T] cross, list[T] is refused |
reuses 0006 |
| 0059 | The standard library: compiled where CPython's results and raises are reproduced exactly, the explicit boundary for the rest; modules written in POST compiled per element type | decides A145, A166 |
| 0061 | Files and standard input: a file an instance closed by its last release, text and binary files read and written as CPython's io does, sys.stdin and input() |
under 0059; an instance kind of 0024 |
| 0060 | Module-level values: globals owned by the module, read by every function, rebound after global, defaults evaluated once |
decides A148, A160; adds an owner to 0024; reverses A88 in script builds |
Exceptions¶
| 0007 | The vocabulary, the error-return lowering, both FFI directions; exception classes a script defines, with fields; a handled record released; the pending check a load in a one-thread executable; the lowering deciding what is a raiser | amends 0006 and 0026; amended by 0011, 0030, 0033 and 0075 |
The CPython boundary¶
| 0006 | The CPython FFI: the boundary, conversions, data operations, object, exports, --pure |
consolidates 0008, 0009 (2026-08-07); amended by 0007 and 0019 |
| 0019 | Compiled code and CPython, across threads | consolidates 0017, 0018 (2026-08-07); amends 0006 and 0010 |
| 0022 | A generated extension module declares Py_MOD_GIL_NOT_USED |
amends 0002 |
pygo: the concurrency profile¶
| 0010 | The pygo surface: channels, scopes, tasks, closures, select |
consolidates 0012, 0013 (2026-08-07); amended by 0011, 0016, 0019 and 0076 |
| 0011 | A per-task exception slot; pygo statuses as POST exceptions | amends 0007 and 0010 |
| 0016 | pygo.net: a compiled TCP server |
amends 0010 |
Measurement¶
| 0067 | Speed is measured against C, on low-level programs, as one index per release | gates releases beside the cross-backend benchmark |
| 0068 | A list element takes the width of its declared type: a list[bool] holds one byte per element, a list[Int32] four |
amends 0027 and 0053 |
Where the rest of the record lives¶
The why behind a semantic choice is usually in the arbitration register (notes/decisions/arbitrations.md, A1–A197), which an ADR cites by number. The questions those choices raise for the base standard are in notes/decisions/upstream-questions.md (U1–U52, none filed). The numbers are in ../../../notes/measurements.md. ../../../notes/accept-then-wrong.md records what each decision got wrong on the way in. (These ranges are maintained by hand: pygo's range guard reaches only pygo's own files.)