Programming · free software · the open webSubscribe via RSS

The notebook index

Post archive

27 posts.

  • A fast wire layout still needs a trust boundaryProtocols · 27 Oct 2026

    Cap’n Proto’s word-aligned layout supports efficient traversal, but a receiver still has to validate bounds and resource use. Serialization also says nothing by itself about who sent a message or what that sender may do.

  • Promise pipelining removes a wait, not a dependencyProtocols · 16 Oct 2026

    Promise pipelining lets a client send a call against a result that has not arrived yet. It can collapse sequential network waits into one round trip, while preserving the dependency and its failure modes.

  • A useful setup log starts with the question it can answerNix and Unix · 08 Oct 2026

    A compact diagnostic record should let someone reproduce a specific observation: state the question, environment, command, exit status, and relevant output. Keep that setup transcript distinct from an inventory of files or storage.

  • A command line is an argument vector before it is a shell stringNix and Unix · 01 Oct 2026

    Passing subprocess arguments as a sequence preserves argument boundaries and avoids shell parsing by default. It prevents shell metacharacters from becoming syntax, while leaving program-specific option handling as a separate concern.

  • Endianness belongs in the format, not in a lucky host assumptionProtocols · 17 Sep 2026

    Binary formats must specify byte order and layout instead of inheriting a machine’s memory conventions. A two-byte example shows why explicit endianness is more portable than native alignment assumptions.

  • A virtual environment has an interpreter boundaryPython and Haskell · 03 Sep 2026

    A Python virtual environment is selected by the interpreter that runs your program. Learn how pyvenv.cfg, interpreter prefixes, shell activation, and python -m pip reveal which environment owns installed packages.

  • Make an invalid state unrepresentable at the interfacePython and Haskell · 20 Aug 2026

    A result type makes success and failure explicit in a function’s interface. In Haskell, Either lets callers distinguish failures by constructor while still requiring validation at untrusted input boundaries.

  • Rolling back NixOS does not roll back a databaseNix and Unix · 06 Aug 2026

    NixOS generations let you select an earlier system configuration, while database files and other mutable data follow their own lifecycle and compatibility rules.

  • The grain is a useful boundary for application stateSelf-hosting · 23 Jul 2026

    A Sandstorm grain is an application instance with persistent state. Treating it as a boundary clarifies sharing, ownership, backup contents, and what a restore must recover.

  • Pass a capability instead of looking up ambient authoritySelf-hosting · 09 Jul 2026

    A capability combines an object reference with permission to use it. Passing a narrow read-only handle can make authority explicit and limited to the resource and operations the recipient needs.

  • Validate CSV headers before building dictionariesPython · 04 Jul 2026

    Check CSV header uniqueness, required names and row widths before mapping fields, preserving IDs such as 007 as strings.

  • Testing a schedule cache across feed revisionsProtocols · 30 Jun 2026

    Include feed and revision in cache identity to isolate updated schedule data; demonstrate failed loads and pruning in memory.

  • A durable idempotency key in one SQLite transactionSelf-hosting · 26 Jun 2026

    Use a SQLite key, payload digest and counter in one transaction to demonstrate retries, conflicts and persistence across reopen.

  • Parsing GTFS times beyond midnightProtocols · 22 Jun 2026

    Parse GTFS service times as seconds from the service day’s start, allowing hours above 23 while rejecting malformed values.

  • CSV round trips: commas, quotes and embedded newlinesPython · 18 Jun 2026

    Use Python’s CSV reader and writer to round-trip commas, quotes and newlines while accounting for type loss and spreadsheet formula risks.

  • A byte stream does not know where your messages endProtocols · 14 Jun 2026

    TCP delivers an ordered byte stream, so an application protocol must define message boundaries. A four-byte length prefix provides one simple framing rule, with explicit size limits and buffering for incomplete or coalesced frames.

  • Reading Tempest as a systems projectSelf-hosting · 10 Jun 2026

    Tempest’s repository describes an experimental replacement for Sandstorm, with sandbox setup work and HTTP plumbing already present. Its README is a map of questions to investigate, not evidence for production guarantees.

  • IRC presence is not an appointment to answerFree software · 06 Jun 2026

    IRC exposes connection state and an explicit away message, but neither is a promise about when a person will reply. Treat messaging as asynchronous and write bug reports that include a reproducible exchange.

  • ActivityPub has actor identity, object identity and delivery identityProtocols · 02 Jun 2026

    ActivityPub uses actors to identify accounts, objects to identify content, and activities to describe actions delivered between inboxes. Keeping those identities separate is central to reliable handling of retries.

  • Read the ownership boundary before upgrading an RPC bindingPython and Haskell · 29 May 2026

    Before upgrading a Haskell Cap’n Proto binding, separate schema-generated types, message data ownership, serialization, and RPC behavior. Then check project status, protocol assumptions, and the API changes an upgrade may introduce.

  • Why len(x) is not just x.__len__() in disguisePython and Haskell · 25 May 2026

    Implicit operations such as len use a type-level special method protocol, which differs from ordinary attribute lookup on an instance.

  • A Python name is a binding, not a box containing a copyPython and Haskell · 21 May 2026

    Python assignment binds names to objects, so mutating a shared list is visible through every alias while rebinding one name changes only that binding.

  • A Nix derivation describes a build; it does not prove reproducibilityNix and Unix · 17 May 2026

    A derivation records a build step and its declared dependencies, but matching that recipe does not guarantee identical output bytes when the process can observe undeclared inputs or nondeterminism.

  • Changing a Cap’n Proto schema without renumbering historyProtocols · 13 May 2026

    Cap’n Proto field ordinals preserve a schema’s evolution history. Adding a field can keep old messages readable, provided the new declaration respects ordinal ordering and defaults.

  • Cross compilation: build, host and target are different questionsC and compilers · 09 May 2026

    The build, host, and target labels describe a compiler’s own construction and output roles. Ordinary package cross compilation adds separate questions about headers, libraries, and where the result can run.

  • A closure in C is a function plus an environmentC and compilers · 05 May 2026

    A callback and an explicit context pointer form a portable way to represent closure-like behavior in C. Keeping the environment visible makes its lifetime and calling convention part of the design.

  • C is an abstract machine, even on familiar hardwareC and compilers · 01 May 2026

    C arithmetic follows language rules, not a promise about the processor’s usual instruction. That distinction matters when a compiler reasons about overflow and when code needs a checked result.