Planet Scheme

Sunday, December 6, 2026

jointhefreeworld

How I develop inside Emacs

I do not open an editor to write code. I open a Lisp machine that happens to have my project in it.

That sentence sounds like a slogan until you use a configuration where it is literally true. In heks-emacs every module is an Emacs Lisp file, the key scheme is a data table, the documentation of the keys is written from that table, the package set is a lock file in the repository, and the checks that hold all of it together are Guile programs run through Maak. When something is wrong I can read the form that decides it, change it, and evaluate it in the running session. Nothing in the workflow is a setting I cannot see.

This post is about how that works day to day, why it is built the way it is, and why I think the result is a small repayment of a debt to the GNU Project and to Richard Stallman’s argument about software freedom. It is also honest about the price, because a configuration this size is not free to own.

The workshop, not the tool  #

Most editors are programs you configure. Emacs is a program you inhabit. The difference is not aesthetic. It is architectural: Emacs ships an interpreter, and the editor is written in the language that interpreter runs. That means the boundary between the editor and my configuration is imaginary. A function I write is as real as one that ships with Emacs; a keymap I build is the same kind of object as the global map; a buffer I create is the same kind of object as the one showing this article.

heks-emacs leans on that rather than hiding it. The repository is a directory of small modules, one per topic, loaded in an order init.el declares. The modules are grouped by what a person does rather than by what Emacs calls things: core, UI and palettes, development, Org and knowledge, shell and system, search and navigation, mail, music and maps, writing and rendering, the libraries, and AI. A module owns one subject, and the module declarations say which key topics it may bind.

That rule is enforced, which is what makes it a design instead of a convention. maak modules reads the declarations, the modules on disk, and the keys the configuration actually binds, and fails when a module has no declaration, when a declaration has no module, when a key is bound under a topic its own module did not claim, or when a topic has nobody to answer for it. The manual is not the authority. The code is, and the manual is written from it.

One grammar for every key  #

The key scheme is the part I would rebuild first if I had to start again.

Everything the configuration adds lives under C-c. The next letter names the topic, and the letter after that names the action. The action letters mean the same thing under every topic:

Letter Meaning
a apply an action, or add something
b build
c show the callers of this definition
d debug, or the difference between two things
e evaluate
f format
g go to: a definition, an implementation, a location
h explain: the documentation of what is at point
i insert
k kill: stop a process or a server
l lint, or list the problems
m a menu, or turn the mode on and off
n new, or next
o open
p preview, or previous
r run, or open a REPL
s send to a REPL, or switch
t test
u update
v view, or validate
w write, or work on
x execute a script

So C-c i f and C-c j f both format, but they format different things: one is the buffer, formatted by whoever knows how, and the other is a JVM file, formatted by its own tool. The alphabet is the grammar; the topic is the noun; the action is the verb. Once you have pressed a dozen of them you can guess keys you have never used, which is the whole point of a grammar.

Two details make it learnable rather than merely consistent. which-key is taught the same tables, so C-c is explained while it is being typed, in the words of the topic. And C-c h d echoes the sentence of the key at point wherever one is reading a key: C-c n f: a note, found by title. The key reference is generated from the bindings with maak keys-update and checked with maak keys, so a key that means two things, a binding whose command does not exist, a topic nobody documented, and a key with no sentence of its own all fail the check. The documentation cannot drift from the keymap because the same run writes one and tests the other.

A working day  #

What does that actually look like between waking up and pushing a branch?

Starting the session  #

Emacs starts as a daemon from the compositor, so the first frame appears with the dashboard already there. early-init.el turns off the built-in package manager, hides the menu bar, tool bar and scroll bars before the first frame is drawn, and sets the frame-resize behaviour that makes a larger font stop costing startup time. Then Elpaca bootstraps, the bridge file is read, and the modules load in the declared order.

The bridge file matters more than it sounds. heks-linux-bridge.el or cask-and-cons-bridge.el sets the fonts, the palette, the notes directory and the checkout directory before any module is configured, because the modules read those values while they are being set up. If the bridge ran later, every module that looked at heks/notes-dir would have configured itself around nil. The order is the configuration.

Finding the project  #

The project is where the work is, so the configuration treats it as a first-class thing rather than a directory. The dev-project module owns the project’s tasks, EditorConfig, Maak, Terraform and SQL, and the project’s Maak file is one key away. When I open a file from a repository, the matching environment is already described in that repository: a manifest.scm for Guix, a flake.nix for Nix, a maak.scm for the tasks. Emacs does not have to guess how the project builds; the project says.

Writing code  #

Languages get the same three layers everywhere: a major mode for editing, a language server through Eglot for understanding, and Flymake for the findings I have to fix. Tree-sitter does the structural work where there is a grammar for it. Formatters are wired so that the formatter and the linter agree; when they disagree, every line gets reported twice and the buffer becomes noise.

For Guile and Guix the language server is not a language server at all: it is Geiser talking to a running Guile, which is better, because a REPL is a more honest description of a Lisp than a static index. Common Lisp goes through SLY and SBCL for the same reason. C and GTK 4 go under gdb with GTK’s warnings fatal and the GTK inspector one key away; Kotlin, Java and Spring Boot go under the JVM debugger. All of them through the same C-c b session keys, so debugging a new language is learning a language, not learning a new interface.

Asking the editor about itself  #

Three keys answer questions that would otherwise send me to a search engine:

  • C-c h a says what Emacs, palette, font, modules and version are running.
  • C-c h t walks the five keys a new reader needs, as a buffer of buttons that run the keys they show.
  • C-c ! d is the doctor: every program the modules expect, its version, and what each module does without it.

The doctor’s list is data ( heks/doctor-programs), and maak doctor holds the installation page to it. Adding a module that needs a program means adding the program to the list; the manual then says so, or the check fails.

Notes, tasks and the agenda  #

Notes are plain Org files in a folder. That is the whole database. There is no sqlite file to rebuild, no UUID in every link, and nothing that stops working if Emacs does. A note lives in a topic folder, so ls tells you what the knowledge base is about. A link is a relative path, so grep can follow it and a static site generator can read it. Titles are read from the files, backlinks are a search, and index pages are generated from what is in the folder.

Everything is under C-c n: capture from anywhere, find by title, today’s agenda, the week’s agenda, the backlinks of this note, the graph. The task inbox is a file, the habits are a file with repeaters, contacts and birthdays are files, bookmarks are files. From a terminal, the n command in heks-bash reads and writes the same formats, and writes index pages byte-identical to the ones Emacs writes. Two front ends, one format, no server in the middle.

Everything else a day needs  #

Mail is Gnus, IRC is Circe, the shell is Eshell with a prompt that shows user, host, path and Git branch, aliases for the things I actually type, and project shells opened next to the code they belong to. There is a map, a fretboard for looking up a chord, and a pile of small commands that keep a five-second annoyance from being a five-second annoyance every day. That last category is most of what a personal configuration is, and pretending otherwise is how configurations become unusable.

Document preview is C-c r p: a Markdown file, an Org note, an OpenAPI specification or a plain text file rendered as a themed HTML page with no network. C-c r P turns the same document into a deck. Both are the configuration doing something a proprietary tool would normally do, inside the program I already have open, from the same buffer I am editing.

A configuration that checks itself  #

The feature I am proudest of is not a feature. It is the ladder of checks.

Task What it proves
maak lint Every Elisp file parses, and the module list in init.el matches the modules on disk. Fast, and needs nothing installed.
maak keys No key means two things, every topic is documented, every binding’s command exists.
maak modules Every module is declared, and no key is bound outside the topic its module owns.
maak doctor The programs the modules expect are the programs the manual lists.
maak lock Every queued package is in the lock, with a ref.
maak render The Markdown renderer, as a pure function from a string to HTML.
maak contrast No face goes invisible in any installed palette.
maak test The ERT suite.
maak golden The renderers still produce the pages they produced last time.
maak verify The configuration installs, loads the way Emacs loads it, and its invariants hold.
maak check All of the above, in the order that fails cheapest first.

Two of these deserve a longer look.

maak contrast reads each palette’s own face specs – the colours it writes for a true-colour display, not the batch frame’s, which is a text terminal with eight colours – and computes the contrast between every foreground and the background behind it. Body text is held to WCAG AA, at 4.5:1. The separators, which are this configuration’s own blend rather than a palette’s, are held to a visible 1.5:1. A face a palette painted nearly invisible is repainted at load by heks/set-readable-faces, and the check reads the colour it ends up with, so a correction that stops working fails here. This is what makes “nothing goes invisible when you switch palette” a fact instead of a hope.

maak verify is the slow one: it installs the configuration and then loads it in a batch Emacs the way startup does, asserting that every module loaded, that a fold covers a whole definition, that a checker survives a tool’s decorated output, that nothing breaks without Guix, that a Markdown file renders, and that an OpenAPI file is read and checked. The others are cheap enough to run while working. maak verify is the one you run before sending a patch.

The pattern repeats across the project: the check that validates a thing and the task that writes it are the same program, so the answer to “the document is out of date” is never “edit the document”. maak keys-update writes the keybindings reference from the key tables. maak modules-update writes the module table from heks/module-declarations. maak doctor-update writes the programs the modules expect into the installation page. maak stats refreshes the numbers in the README from a batch Emacs. Documentation is an output of the build, not a second copy of the truth.

Packages that come back the same  #

Elpaca manages the packages, and the package set has a lock in the tree: src/elpaca-lock.eld, one recipe per package, each pinned to a :ref. init.el puts the lock in front of Elpaca’s menu functions, so a package is resolved from the commit the repository pinned before MELPA is asked. A clone on another machine builds the set this repository says, not the set MELPA is serving that afternoon.

Adding a package is two steps: use-package it, then maak lock-update. A bump is maak packages-update, not maak lock-update on its own, because a recipe with a :ref is pinned and Elpaca skips a pinned package rather than updating it. Writing the lock again from a machine that was never updated would record the commits that were already there. The task moves the installed lock aside, runs Elpaca’s own update over every package, puts the lock back whether the run succeeded or not, and writes the refs it installed. It refuses to fetch while a recipe is still pinned or while a source sits on a detached HEAD, because the fast-forward merge needs a branch. HEKS_PACKAGES_DRY=1 asks those two questions and stops, which is how the guards are tested without paying for the update.

What a bump looks like is git diff src/elpaca-lock.eld: one commit per package, which is the shape a lock file is for. The bootstrap, elpaca and elpaca-use-package, is not in the lock, because it is read before the lock is; its recipe in init.el is its pin.

The editor I actually run  #

I run GNU Emacs built from the upstream master branch: pure GTK, native compilation ahead of time, Tree-sitter, ImageMagick. At the time of writing that is 32.0.50. The manual has a page for the build: the checkout from Savannah, the dependencies and their package names on openSUSE and Debian, the flags with the reason each is there, the install and the uninstall, the rebuild loop, and what to do when the distribution moves a library the binary was linked against.

The price is honest. A distribution’s Emacs is built for everybody; mine is built for me. Nothing else on the machine updates it, and a distribution that moves a library ahead of it takes it down until I rebuild. That is the same trade as running a Lisp I can change: the artifact is mine, so its maintenance is mine too. The difference is that this one pays me back every day, because a bug in master fixed upstream can be in my hands the same day, and because the build is the one the configuration is developed against rather than an approximation of it.

Plain files, and why that is the point  #

There is a theme running through all of this that is easy to miss because it is not a feature. The notes are files. The tasks are a file. The key scheme is a table in a file. The lock is a file. The documentation is generated from files. There is no service to keep running, no database to migrate, no proprietary store holding the state of my own work.

That has consequences worth stating plainly:

  • Everything can be read with the tools that already exist. grep, git diff, less and a text editor that is not Emacs all understand the knowledge base.
  • Everything can be reviewed. A refactor of the whole notes tree is a reviewable diff. A package bump is a diff. A key change is a diff plus the generated reference.
  • Everything can be thrown away and rebuilt. Titles come from the files. Index pages are generated. Backlinks are a search. Search is a search. Nothing depends on state that cannot be recreated from the source.
  • Everything survives the program that made it. If Emacs disappeared tomorrow, the notes would still be Org files, the tasks would still be Scheme, and the keys would still be a table somebody could read.

That last property is not a hypothetical for me. It is the difference between using a tool and being a tenant of one.

What Stallman and the GNU Project have to do with it  #

heks-emacs is a GNU Emacs configuration. That is not a coincidence of tooling; it is a consequence of taking the Free Software Foundation’s argument seriously.

The argument, in the shortest form that is still honest, is that software is a set of rules for your own machine, and that a user who cannot read, change, redistribute or improve those rules is not fully in control of the machine. The four freedoms are not a licence checklist; they are a description of what ownership means when the thing owned is executable text. Stallman has spent forty years making a specific claim: that convenience purchased with control is a bad trade, and that the alternative has to be built rather than wished for. Emacs, GCC, Guile, Guix and the rest of the GNU system are that alternative, built.

I write my configuration in Emacs Lisp because the program is one I can change while it runs. I use GNU Guile for the tasks because it is GNU’s extension language and because a build file should be a program, not a configuration format. I use GNU Guix for environments because it makes the dependency graph explicit and lets me pin it in the repository. I name the system GNU/Linux, not Linux, and I say free software rather than open source, because the distinction is the argument: open source describes a development model, free software describes what the user is allowed to do. The site you are reading is built the same way, from Org files, by an Emacs Lisp program, and it degrades without JavaScript rather than requiring it.

There are smaller forms of the same respect, and they add up:

  • The fonts are libre. The palettes are libre. The tools are libre. A configuration that spends its day in a proprietary text stack is making a claim it does not believe.
  • Releases are tagged, signed where the project signs, and published with sources. The Guix channel is OpenPGP-authenticated, not merely downloaded; its history is verified against an introduction and a maintainer fingerprint.
  • The manual is part of the work, not an afterthought. GNU projects have always been judged by their documentation, and a generated reference that cannot drift is the Emacs tradition of self-documentation taken seriously.
  • Nothing is hidden behind an account. There is no telemetry I added to this configuration, no login to edit a file, and no network call where a local computation would do.

Honoring Stallman does not require agreeing with everything he has ever said, and I do not. It requires taking the central question seriously: who gets to change this, and what happens to the person who cannot? The answer in this repository is that the person can change it, and the configuration is arranged so that they can find where. That is a small thing to do with a text editor. It is also the whole thing, done at the scale one person can actually control.

The AI question, answered in public  #

A configuration written in 2026 has to say where it stands on AI, and this one says it in a written policy rather than in a shrug.

heks-emacs has two front ends: GPTel for asking a question about what is at point, and ECA for a chat that reads and edits the project. Both talk to one of two accounts, and the account is a property of the project rather than of the checkout: heks/ai-provider resolves to a provider, HEKS_AI_PROVIDER names one outright, and C-c x P writes the choice into the project’s own .dir-locals.el as a value that may only be one of the two known providers. A directory-local file is data; a setting that can only name copilot or deepseek is one that cannot run code.

The key never lives in the repository. It is looked for in DEEPSEEK_API_KEY, in a GPG-encrypted file outside the checkout, or in an auth-source entry, in that order, and a missing key is an error naming all three rather than a request that comes back as a 401. The environment variable is not the recommended place, because Emacs here is a daemon started by the compositor: a line in ~/.profile never reaches it, and what is exported is inherited by every process it starts.

The policy is the part that matters. A human is the author of record and is accountable for every commit. Test-driven development is required for every behaviour change. An agent runs the checks and records the commands and their output, and a red suite, a dirty tree or a checklist nobody ran is not a merge. An agent never weakens a test, edits CI to get a green run, or changes the licence or the policy without a person’s agreement.

That is the same standard I would apply to any other tool: it may make me faster, but it may not take away my ability to read, test and change what it produced. A tool that makes the code less mine is not a tool I want in the workshop, however clever it is.

What it costs  #

I would not trust a post like this without the bill.

The configuration is more than 140 packages, more than 500 functions, more than 180 tests and more than thirty palettes. That is a lot of surface, and surface needs maintenance: a package that changes an API, a language server that starts returning decorated output, a palette that repaints a face the contrast check then has to repair. The checks are what make the maintenance tractable, but the checks are also work. maak verify is slow. maak packages-update can fail on a package that has moved, and the failure is a real afternoon. Building Emacs from master means being your own distributor.

The payoff is not that the configuration is perfect. It is that when it is wrong, I can find the form that is wrong. That property is worth a weekend a year, and it is the reason I keep the whole thing in one place instead of spreading it across a dozen dotfiles and a package manager I do not control.

Starting from here  #

If you want to try it rather than read about it:

git clone https://codeberg.org/jjba23/heks-emacs.git
 cd heks-emacs
maak install-emacs-config
copy

That copies the configuration into ~/.emacs.d, where src/init.el reads it and Elpaca installs the packages on the first start. If you would rather read first, the sequence that explains the design is: the manual, then the keybindings reference, then the module table, then maak check. The manual is generated from the same tables the checks use, so it is the shortest honest path into the configuration.

If you take one idea away, take the one that survives the specifics: a tool you can change while it runs is a different kind of tool from one you can only configure. Emacs has been that kind of tool for forty years because the GNU Project insisted that it could be. Building on it is the least I can do, and the most useful thing I own.

The rest of this series is about the parts around the editor: the environments the projects are built in, the task file that runs them, and how the results are packaged for the distributions.

Sunday, December 6, 2026

Guix and Nix in my projects: one source, two reproducible worlds

I do not install a toolchain on a machine any more. I describe one in the repository, and enter it.

That decision has a cost and a payoff that are easy to state. The cost is four files per project and a little discipline about pins and hashes. The payoff is that a checkout from three years ago still builds, that CI runs the same commands I run, and that a contributor does not need a paragraph of installation instructions before the first maak check. There is no “works on my machine” left to say, because the machine is in the tree.

This post is about the arrangement I use in ~/Hacking/: three Guix files, one Nix flake, a pinned channel set, and a signed Guix channel that packages the whole collection. It is also about why both Guix and Nix, since the honest answer is not “one won”.

The three Guix files  #

Every project keeps the same three files, and each answers a different question.

guix.scm answers “what is this program?”  #

It is a package definition, the same kind of thing the Guix repository itself carries: a name, a version, an origin, a build system, inputs, a synopsis, a description and a licence. What makes it a development file rather than a release recipe is the source:

( define  %source-dir
  (dirname (current-filename)))

( define-public  maak
  (package
    (name  "maak")
    (version  "dev")
    (source
     (local-file %source-dir
                  #:recursive? #t
                  #:select? (git-predicate %source-dir)))
    (build-system guile-build-system)
     ;;  ... inputs, synopsis, description, licence, and the phases that
     ;;  install the launcher and the manual page.
    ))
copy

The local-file with git-predicate packages the working tree while leaving out everything Git ignores, so an untracked build directory does not become part of the source. The version is "dev" because this is the checkout, not a release: the release tag gets its own version from the tag. The rest of the file is ordinary Guix, with the additions a real program needs – the launcher, the completions, the manual page, the help screen installed where the program looks for them, and the interpreter paths rewritten to the store.

That file is what makes guix build -f guix.scm work from the checkout, and what the Guix channel later turns into a released package.

manifest.scm answers “what do I need to work on it?”  #

It is the development environment, and it is deliberately not the package’s inputs. It holds the tools a person uses, not the libraries the program links:

(packages->manifest (list texinfo
                          darkhttpd
                          watchexec
                          emacs-no-x
                          librsvg
                          font-dejavu
                          node))
copy

That is the site’s manifest, and every entry has a reason written beside it in the file. librsvg provides rsvg-convert, which draws the per-article social cards, and font-dejavu is what it draws the text with, so both have to be declared rather than hoped for. node runs the pinned esbuild and tsc from package.json. darkhttpd serves the result, watchexec rebuilds on a change, emacs-no-x builds the site, and texinfo is there for the manual pages.

The rule I follow is that a tool which is needed to run a task belongs in the manifest, whether or not it is a build dependency of the package. The task list and the manifest should describe the same machine.

channels.scm answers “which Guix, exactly?”  #

This is the file that makes the other two reproducible:

(list (channel
        (name 'guix)
        (url  "https://git.guix.gnu.org/guix.git")
        (branch  "master")
        (commit
           "ecbebf72c5f59f96aed8d18cfdd0097d7230a1e2")
        (introduction
          (make-channel-introduction
             "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
               "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))
copy

A commit and an introduction: the commit says which Guix, and the introduction says which history is trustworthy and from which commit the signatures start. Guix verifies the commits it fetches against that introduction, so a moved branch or a rewritten history is an error rather than a silent upgrade.

Projects that also need my own packages add the channel:

(channel
  (name 'jointhefreeworld)
  (url  "https://github.com/jjba23/guix-jointhefreeworld")
  (branch  "trunk")
  (commit  "bd5facf3bc6fbc3726ce3df6f599749236ae3f87")
  (introduction
   (make-channel-introduction
     "b0ac3f05075d7959860fc9e1db5871acddea3986"
    (openpgp-fingerprint
      "83BC 6E1C 8726 B8C2 97F8  D16E 24F4 6738 CE11 4AF6"))))
copy

Three files, three questions, and the fourth question – “which commands?” – is the Maak file.

The pinned shell is the only shell  #

The point of channels.scm is not documentation. It is an entry point:

guix time-machine --channels=channels.scm -- shell -m manifest.scm
copy

That command gives a shell with the manifest’s packages, built by the Guix at the pinned commit, on whatever distribution the machine happens to run. The shell is not “close enough” to the environment the project was developed in; it is the environment, as far as any two machines can have the same one.

I could write that command in every README and every CI file. Instead, Maak wraps it:

( define ( js-run args)
   "Run ARGS with the pinned Node, which is where the js tools get a runtime."
  (time-machine-manifest-shell args
                                #:verbose? #t))
copy

So maak lint-js, maak test-js and maak build-js do not need Node on the machine. maak build does not need an Emacs of the right version on the machine. maak hot-reload runs watchexec from the manifest. The site build is the clearest case:

(time-machine-manifest-shell
 (list  "emacs"  "-Q"  "--batch"  "-l"  "./jointhefreeworld-site.el"
        "--funcall"  "jfw/publish")
  #:env (list (~  "CI=~a" ( if ci?  "true"  "false")))
  #:verbose? #t)
copy

-Q is not decoration. It means the build does not read my personal Emacs configuration, so a package I happen to have installed cannot change the output. The build’s environment comes from the manifest and nothing else. That is the difference between a build that is reproducible and one that merely runs.

Why pin a commit instead of installing Guix and moving on  #

Because “the latest Guix” is four different environments in a week, and because the pin is reviewable. A change to channels.scm is a one-line diff that says “the whole project moves to this Guix”, and git log can answer when it moved and why. A guix pull answers none of that.

There is also a harder reason. The GTK4 programs need Rust 1.92. Guix 1.5 ships 1.85. An unpinned build stops in the build phase with the crates’ own minimum-supported-Rust message, which is a good error but a wasted afternoon. The pinned revision in the channel has the toolchain those programs were written against. Pinning is not nostalgia; it is the only way to build software whose requirements are ahead of the distribution’s default.

A signed channel is a package collection with a history  #

guix-jointhefreeworld is a Guix channel: a package collection Guix can pull alongside its own. It is not a fork of Guix and not an operating system. It carries the Guile libraries the projects share, the command-line programs, the Emacs packages, the GTK4 desktop programs, and the site builder.

The part that matters here is that the channel is authenticated. The channel’s own .guix-authorizations names the keys allowed to sign its commits, and the introduction names the commit where the trust starts. guix pull verifies the history from that point, and guix git authenticate can be run by hand. A channel that is merely downloaded is a convenience; a channel with an authenticated history is a supply-chain statement.

The maintenance loop is Maak tasks:

Task What it does
maak build Builds one package, or every package in the manifest, at the pinned revision.
maak lint Lints every package; reaches the network for the updater and CVE checks.
maak check Lints offline, builds every package, then authenticates the history. This is the gate.
maak outdated Runs guix refresh with the generic-git updater, comparing each package with its repository’s tags. One fetch per package, no token, no rate limit.
maak shell Opens a shell with every package in the channel.
maak authenticate Verifies the signatures from the introduction to HEAD.
maak publish Pushes the authenticated trunk and the keyring branch.

Two details from that file are worth stealing. maak check uses guix lint --no-network before the build, so a CI run does not depend on an updater’s network being up; the network-touching lint is a separate task a person runs. And the certificate handling in maak outdated is explicit: guix refresh reads tags through libgit2, which verifies repository certificates against the system trust store. A Guix installed on another distribution may have no /etc/ssl/certs to offer it, so the task builds Guix’s nss-certs and points SSL_CERT_DIR at it. That is the kind of thing that makes a tool feel broken until somebody writes down why it is not.

The Nix side  #

Nix is not a second hobby. It is the compatibility surface: some users and CI systems already have flakes, some are on NixOS, and some are on macOS where Guix is not an option. So every project also carries a flake, built from the same source and the same tests.

The flake is thin on purpose. Maak’s is a good example:

{
  description = "Maak - The infinitely extensible command runner à la Make (Guile Scheme)";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  };

  outputs = { self, nixpkgs }:
    let
      supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
      pkgsFor = system: nixpkgs.legacyPackages.${system};
    in
    {
      packages = forAllSystems (system:
        let
          pkgs = pkgsFor system;
        in
        {
          maak = pkgs.callPackage ./default.nix {};
          default = self.packages.${system}.maak;
        });

      apps = forAllSystems (system: {
        maak = {
          type = "app";
          program = "${self.packages.${system}.maak}/bin/maak";
        };
        default = self.apps.${system}.maak;
      });

      devShells = forAllSystems (system:
        let
          pkgs = pkgsFor system;
        in
        {
          default = pkgs.mkShell {
            inputsFrom = [ self.packages.${system}.maak ];
            packages = with pkgs; [
              guile
              coreutils
              util-linux
            ];
          };
        });
    };
}
copy

The derivation is in default.nix (or package.nix for the Rust and GTK programs), and the flake only exposes it. nix build .#maak, nix run .#maak -- --list, nix develop and nix profile install all work from that one file.

The same discipline as the Guix side applies, in a different language:

  • The version is read from the source, not repeated. Maak’s default.nix reads src/maak/version.scm and parses the version out of it, so the derivation cannot fall behind the program. Lambdock goes the other way: package.nix is the version source, and maak sync-version writes that version into the PKGBUILD, the RPM spec, the Void template, the AppStream metadata and Cargo.toml.
  • The dev shell is the tools, not the package. inputsFrom pulls in the package’s own inputs; the extra packages are what a person needs: clippy, rustfmt, rust-analyzer, ccls, watchexec, xvfb-run and rustPlatform.rustLibSrc. That last one is what makes the editor show the standard library’s signatures and documentation instead of guesses. A dev shell is a working environment, not a smaller build.
  • Platforms are declared once. The GTK4 and Wayland programs stay on Linux; each project’s expression says so, and the aggregate reads it from there rather than from a list kept by hand.

One flake for the whole collection  #

nix-jointhefreeworld is the aggregate: eighteen programs, seven Guile libraries, five Emacs packages, and the five Guile dependencies nixpkgs does not have yet. One flake.lock pins every project, so a consumer gets one revision known to build together instead of thirty-five URLs to keep in step.

Two design choices make it maintainable. Each package is built by the expression in its own repository – the Guile projects’ default.nix, the elisp projects’ default.nix next to the .el file – so the aggregate never restates how something is built and the two cannot drift apart. And the five missing dependencies are built from branches of a nixpkgs fork until the branches are merged, which is the honest way to carry a patch: visible, pinned, and easy to delete when upstream takes it.

nix flake check builds the whole set and runs every Emacs ERT suite. That is the Nix-side equivalent of maak check, and it is deliberately not a rewritten test suite: the tests come from the projects.

How the two stay in step  #

The two ecosystems could easily become two projects. The arrangement that prevents it is simple:

Question Guix answer Nix answer
What is the package? guix.scm default.nix or package.nix
What is the environment? manifest.scm the flake’s devShell
Which dependencies, exactly? channels.scm + content hashes flake.lock + fixed-output hashes
What proves it works? maak check in the pinned shell nix flake check
How is a release made? maak release, then the channel updates maak release, then the flake lock updates
Who is it for? my daily environment, and Guix users NixOS, CI, macOS, and people who already have flakes

The rule underneath the table is that neither side owns the build logic. The build steps live in the project – its Makefile-free task file, its xtask, its cargo build, its Guile modules – and both package expressions call them. When a build step changes, it changes once, and the two packagers pick it up.

That is also why the release ritual is one task rather than two. maak release writes the version into every file that carries a copy, writes the changelogs, runs the gate, commits, tags and pushes. The Guix channel follows the tag; the flake lock follows the tag; the distribution recipes follow the tag. If the copies disagree, maak version-check fails before a release can be cut.

Traps I have already paid for  #

  • A pin that never moves is a fossil. The channel commit and the flake lock need deliberate updates, or the project is developed against a Guix from last year. I treat both as part of a release, not as background noise.
  • Hashes are the price of purity. A source tarball that changes its hash is a build that fails, which is the point. The checksum in a distribution recipe has to be refreshed after the archive is published; no task can know it before then.
  • Network in a build is a bug. guix build and nix build run in environments where the network is not there. A task that downloads during a build works on my machine and fails everywhere that matters. Fetch in a development task, or declare the input.
  • Vendored crates need care. cargo build --offline --locked is the rule, and a clean step that deletes *.orig files can break the vendor tree’s checksums unless it excludes it. That is a one-line fix with an afternoon of confusion behind it.
  • Certificates are part of the environment. The libgit2 trust-store problem above is not Guix’s fault; it is what happens when a package manager runs on a system whose certificate layout it does not own. Write the workaround down.
  • Two ecosystems double the surface. The aggregate and the channel are both green or the release is not done. That is a real cost, and the only reason to pay it is that the users are on both sides.

Start smaller than I did  #

If you are starting from nothing, the order that worked for me is:

  1. Write manifest.scm. One file, one list of tools, and guix shell -m manifest.scm gives a colleague the same environment. This is the highest value per line of the three.
  2. Add channels.scm with a pinned Guix commit. Now the manifest means the same thing next month.
  3. Add guix.scm when you want guix build -f guix.scm, or when you want the project in a channel. Do not write it first; a package definition is a promise about installation, and the manifest is a promise about development.
  4. Add flake.nix last, when somebody actually needs Nix. It is cheap once the build is already described by one command.

The test of the arrangement is not that the files exist. It is that a fresh machine with Guix, Git and a network can run one command from the README and get a working build, and that the same command in CI gets the same answer. Everything else is decoration.

I use both Guix and Nix because different people arrive with different tools, and because a second implementation is a second check on whether the first one described the software or only described one packager’s habits. Guix is where I live; Nix is where the project has to be a good guest. Keeping both honest is the same job as keeping the code honest: say what you depend on, pin it, and let a check fail when the story stops being true.

The rest of this series: developing inside Emacs, the task file that drives all of this, and packaging the results for the distributions.

Sunday, December 6, 2026

Packaging my projects for GNU/Linux distributions

Writing the program is half the work. The other half is making it installable by somebody who did not build it, on a machine you have never seen, with a toolchain you do not control.

That second half is packaging, and it is where a lot of free software quietly stops. A repository with a good README and no package asks every user to become a builder. Most people will not. The ones who do will build a slightly different thing than you did, in a slightly different environment, and some of them will file bugs that are really installation bugs. A package is how you stop guessing which of those happened.

This post is about how I package the projects in ~/Hacking/: one directory per format, one version written by hand, one release loop, and a set of habits that came from watching a package build succeed on my machine and fail in a chroot. It covers Debian, Arch, openSUSE/Fedora, Void, Homebrew and Flatpak, with Guix and Nix as the two I treat as first-class rather than as an afterthought.

Why packaging is part of the software  #

A package is a promise with three parts: this is what the program is, these are the files it installs, and these are the things it needs to run. The distribution’s job is to make that promise fit its own rules – the filesystem layout, the package database, the security model, the update policy. Your job is to make the promise true without lying about the first part.

That framing explains most of the work. The program may be correct and still be a bad package: a launcher with a shebang that points at a path the distribution does not have, a library installed where the distribution’s interpreter does not look, a man page that never gets installed, a licence file that is missing, a test suite that needs the network, a build that silently uses a dependency that is not declared. None of those are bugs in the code. All of them are bugs in the package.

The habit that catches them is simple: build the package in the distribution’s own clean environment, install it there, and run the installed program. Not the build tree, not a wrapper script in the repository – the files the package actually puts on disk.

The layout  #

Every repository keeps its distribution recipes under packaging/, one directory per format, beside the two files that are packages in their own right: guix.scm and the Nix expression.

Path What it is
packaging/debian/ debian/control, rules, changelog, copyright, watch, tests/
packaging/arch/PKGBUILD The Arch recipe
packaging/opensuse/*.spec + *.rpmlintrc + _service openSUSE and Fedora/RHEL
packaging/voidlinux/template The Void template
packaging/homebrew/Formula/*.rb The Homebrew formula
packaging/flatpak/*.yaml The Flatpak manifest
guix.scm, manifest.scm, channels.scm The Guix package, environment and pin
flake.nix, package.nix or default.nix The Nix flake and derivation

The reason to keep them all in one tree is not tidiness. It is that they share a version, a source archive and a set of facts (the program’s name, its licence, its data files, its completions, its manual page). When one of those facts changes, all of them have to change, and a review that sees them together is a review that can notice.

One version, written once  #

The version is the first thing that goes wrong in a multi-format repository. It appears in the Arch recipe’s pkgver, the RPM spec’s Version, the Void template’s version, the AppStream metadata’s , the language package manager’s manifest, the Debian changelog, the manual page and the changelog’s newest heading. Seven copies and one truth.

The arrangement I use is: one version source, a pattern for every copy, and a task that writes them.

( define  version-source  "package.nix")
( define  version-source-pattern
   "version[ \t]*=[ \t]*\"([0-9]+\\.[0-9]+\\.[0-9]+)\"")

( define  version-copies
  '(
    ( "data/org.jointhefreeworld.lambdock.metainfo.xml" .  ")
    ( "packaging/arch/PKGBUILD" .  "pkgver=([0-9]+\\.[0-9]+\\.[0-9]+)")
    ( "packaging/opensuse/lambdock.spec" .  "Version:[ \t]+([0-9]+\\.[0-9]+\\.[0-9]+)")
    ( "packaging/voidlinux/template" .  "version=([0-9]+\\.[0-9]+\\.[0-9]+)")
    ( "rust/Cargo.toml" .  "\\[package\\][^[]*version = \"([0-9]+\\.[0-9]+\\.[0-9]+)\"")))
copy

maak sync-version rewrites only the captured span, so a recipe keeps its alignment and a document keeps its wording. maak version-check is the reading half: it fails when a copy disagrees, and a release refuses to proceed while any of them does. The pattern is found rather than assumed, and a pattern that stops matching is an error instead of a check that silently passes on nothing.

The one thing the task cannot know is the checksum. The source archive is published by the forge after the tag is pushed, and its hash does not exist until then. So the sequence is: release, wait for the archive, refresh the checksums from the published file. That step is written down in each recipe’s comment rather than hidden in a task that pretends to do it. A release process that lies about one step is worse than one that admits a step.

Debian  #

Debian is the format with the most paperwork, and the paperwork is the point: it is what makes a package reviewable by somebody who has never met you.

debian/control  #

Source: maak
Section: devel
Priority: optional
Maintainer: Josep Bigorra  
Build-Depends:
 debhelper-compat (= 13),
 guile-3.0,
 guile-3.0-dev,
 pkg-config,
Standards-Version: 4.7.0
Homepage: https://github.com/jjba23/maak
Vcs-Git: https://github.com/jjba23/maak.git -b trunk
Vcs-Browser: https://github.com/jjba23/maak
Rules-Requires-Root: no

Package: maak
Architecture: any
Depends:
 ${ misc:Depends},
 ${ shlibs:Depends},
 guile-3.0,
Suggests:
 curl,
 git,
 tar,
 unzip,
 zip,
Description: command runner whose task list is a Guile Scheme file
 ...
copy

Two details are not decoration. Rules-Requires-Root: no says the build does not need root, which is a claim the build has to keep true. And ${shlibs:Depends} is there even though the program is interpreted: it is the hook that picks up any shared library the packaging helper finds, and removing it because “it is only Scheme” is how a dependency goes missing on another architecture.

debian/rules  #

The interesting part of a Guile package is where the modules and their compiled forms go. Debian does not use one directory for both: modules live under /usr/share/guile/site, and the byte-compiled .go files live under the multiarch libdir. Hard-coding either is a package that installs and then cannot start.

SITE_DIR := $(shell $(PKG_CONFIG) --variable=sitedir $(GUILE_PC) 2>/dev/null)
CCACHE_DIR := $(shell $(PKG_CONFIG) --variable=siteccachedir $(GUILE_PC) 2>/dev/null)

GUILD := $(or $(shell command -v guild-3.0 2>/dev/null),$(shell command -v guild 2>/dev/null))
copy

Asking guile-3.0.pc rather than writing the pair down is what puts the compiled files where the Guile this package depends on looks for them. guild is found rather than assumed, because Debian ships it under the versioned name in guile-3.0-dev and has no plain guild.

The build byte-compiles every module, and a module that does not compile fails the build. That is deliberate: a package that ships sources without their compiled form runs slower on first use and hides the reason. The install then asks the installed tree the question an installer asks it:

env -u GUILE_LOAD_PATH -u GUILE_LOAD_COMPILED_PATH \
  ./debian/maak/usr/bin/maak --version
env -u GUILE_LOAD_PATH -u GUILE_LOAD_COMPILED_PATH \
  ./debian/maak/usr/bin/maak --completion bash > /dev/null
copy

The Guile paths are cleared for the run so that what is being asked is what this tree holds, not what a profile elsewhere on the build machine carries. That is the whole trick of packaging: make the test unable to see your development environment.

override_dh_auto_test is empty, and the emptiness is explained in the file. The project’s test framework is not in Debian, and a test suite that needs packages the distribution does not carry would either be disabled silently or fail for the wrong reason. What can be asked of the installed package without them is asked in debian/tests/ instead.

debian/tests/  #

An autopkgtest that runs the installed program is worth more than a build-time unit test for one reason: it tests the thing the user gets. This is the core of Maak’s debian/tests/smoke, with the helper functions and the cleanup trap left out:

maak --version | head -n 1 | grep -qE  '^maak [0-9]+\.[0-9]+\.[0-9]+$'
maak --version | grep -q  '^License: MIT$'

 work=$( mktemp -d)
 trap  'rm -rf "$work"' EXIT
cat > "${work}/maak.scm" << 'EOF' 
(define-module (maak)
  #:declarative? #t
  #:use-module (maak maak))

(define (greet name)
  "Greet NAME."
  (run (list "echo" "hello" name)))
EOF
 cd  "${work}"

maak --list | grep -q  'greet'
maak --plan greet world | grep -q  'echo hello world'
maak --dry-run greet world | grep -q  'echo hello world'
[  ! -e hello ] || fail  "the dry run wrote a file"
maak --completion bash | grep -q  'complete'
copy

It checks that the launcher starts the interpreter under the name Debian installs it by, that it reads a Maak file of its own in a directory of its own, that the listing prints the docstring, that a plan shows the argv without running it, that a dry run leaves nothing behind, that the completion is generated from the installed library, and that an unknown task fails with a non-zero status. Every answer is read from the installed program; nothing reaches the source tree.

The remaining Debian files are small but not optional: watch tells uscan where the tag archive is and how to rename it into the tarball dpkg-source expects; copyright is the machine-readable licence record, including the fact that a generated file contains text from two other MIT projects; source/format is 3.0 (quilt); maak.docs and maak.manpages install the documentation and the manual page; dh_missing --fail-missing refuses a package that leaves a staged file behind.

When the language is Rust  #

Lambdock is Rust plus Guile plus GTK, and its debian/rules records two lessons:

override_dh_clean:
	dh_clean -X 'rust/vendor/*'

override_dh_auto_build:
	cargo build --offline --locked --release

override_dh_auto_test:
	cargo test --offline --locked

override_dh_auto_install:
	cargo run --offline --locked -p xtask -- install --prefix /usr --destdir debian/lambdock
copy

--offline --locked because a Debian build must not fetch crates. dh_clean -X 'rust/vendor/*' because dh_clean deletes *.orig files across the tree, and vendored crates ship Cargo.toml.orig, which cargo’s checksum files name: cleaning them breaks the next build. And the crate asks for a newer rustc than Debian 13 has, which is stated in the file rather than discovered by the first user who tries to build it.

Arch  #

The Arch recipe is a shell script with three functions and a metadata block, and it is the format that most rewards being explicit.

 pkgname=maak
 pkgver=1.6.6
 pkgrel=1
 pkgdesc= "Command runner à la Make using Guile Scheme"
 arch=( 'any')
 url= "https://github.com/jjba23/maak"
 license=( 'MIT')

 depends=( 'bash'  'coreutils'  'guile'  'util-linux')
 makedepends=( 'guile'  'pkgconf')
 checkdepends=( 'veritas'  'unzip'  'zip')

 source=( "$pkgname-$pkgver.tar.gz::https://github.com/jjba23/maak/archive/refs/tags/v$pkgver.tar.gz")
 sha256sums=( 'd1779a169480b8e851a6734615f4eb9651b24bdcd7c63a32f2bd7fbbf0558c7f')
copy

The same pkg-config question is asked in _site_dir and _compiled_dir, with a fallback for a machine where the .pc file is absent. build byte-compiles the modules into a staging directory, mirroring the source tree. check runs the project’s own test suite with the environment variables that tell it where the tests are. package installs the launcher, the modules, the compiled forms, the help screen, the three completions, the man page, the licence, the README, the NEWS and the docs.

namcap is run on the PKGBUILD because it catches the things a human reviewer of a small package tends to skip: a dependency that is used but not declared, a file installed outside the expected prefix, a missing licence. It is not a substitute for reading the recipe. It is a cheap second pair of eyes.

openSUSE and Fedora/RHEL  #

The spec file is older than most of the projects it packages, and it shows in useful ways. The build starts from a source archive, unpacks it with %autosetup, and rewrites the shebangs:

%prep
%autosetup -n %{name}-%{version}
sed -i  '1s|^#!%{_bindir}/env \(.*\)$|#!%{_bindir}/\1|' scripts/maak
copy

#!/usr/bin/env guile is right in a checkout and wrong in an RPM: the package’s interpreter is a declared dependency at an absolute path, and the build should fail if it is missing rather than pick up whatever env finds. The install then uses the distribution’s own macros:

%install
 SITE_DIR= "%{buildroot}%{_datadir}/guile/site/3.0"
 CCACHE_DIR= "%{buildroot}%{_libdir}/guile/3.0/site-ccache"
copy

%{_datadir} and %{_libdir} are not cosmetic. On a 64-bit openSUSE, %{_libdir} is /usr/lib64, and a recipe that writes /usr/lib installs a compiled file the interpreter will not read on that architecture. This is the same class of bug as the Debian one, in a different syntax.

The spec’s %changelog is maintained by the release task: maak release inserts an entry with a C-locale date, so rpm -q --changelog reads the same on every machine. rpmlint and a .rpmlintrc that documents the accepted exceptions are part of the work, and a _service file records how the source archive is fetched for the openSUSE build service.

Void  #

Void’s templates are short, and they make the split between host tools and runtime dependencies explicit:

 pkgname=maak
 version=1.6.6
 revision=1
 depends= "bash coreutils guile util-linux"
 hostmakedepends= "guile"
 short_desc= "Command runner à la Make using Guile Scheme"
 maintainer= "Josep Bigorra  "
 license= "MIT"
 distfiles= "${homepage}/archive/refs/tags/v${version}.tar.gz"
 checksum=d1779a169480b8e851a6734615f4eb9651b24bdcd7c63a32f2bd7fbbf0558c7f
 wrksrc= "${pkgname}-${version}"
copy

do_build compiles the modules; do_install uses vinstall, vcopy and vlicense so the package’s file list stays inside the template’s own vocabulary. hostmakedepends versus depends is the same distinction as Debian’s Build-Depends versus Depends, and getting it wrong is how a package acquires a build tool it does not need at runtime, or a runtime dependency it never declared.

Homebrew  #

Homebrew is not a GNU/Linux distribution, but a project with macOS users needs it, and the formula is a good exercise in not assuming Linux. Maak’s formula is a formula rather than a cask or a gem, because the program is command-line Guile that builds from source: a cask installs a prebuilt macOS bundle, which this is not, and a gem is Ruby code for Ruby’s package manager, which this is not either.

The install keeps the library, the help screen and the compiled cache together under libexec, byte-compiles into the Cellar, and then writes small wrappers into bin:

path = [
   " #{Formula["coreutils"].opt_libexec} /gnubin",
   Formula[ "gnu-getopt"].opt_bin,
   Formula[ "guile"].opt_bin,
   "$PATH",
].join( ":")

 %w[maak maak-tasks maak-zed].each  do |name|
  (bin/name).write  <<~SH
    #!/bin/bash
    export PATH=" #{path} "
    export GUILE_LOAD_PATH=" #{site} "
    export GUILE_LOAD_COMPILED_PATH=" #{cache} "
    exec " #{bin_dir/name} " "$@"
  SH
  (bin/name).chmod 0755
 end
copy

The wrapper is there because the launcher expects a GNU userland and a GNU getopt, and because the library’s load path has to be set before the program starts. The formula’s test block then does what the Debian autopkgtest does: it writes a tiny Maak file in a temporary directory and asserts that the installed program lists the task, reads the docstring, and prints its version. A package without a test block is a package nobody has run after installation.

Flatpak  #

Flatpak is a different kind of package: not a file layout for a distribution, but a sandbox with a runtime and a permission list. Lambdock’s manifest starts with the identity and the runtime:

app-id: org.jointhefreeworld.lambdock
runtime: org.gnome.Platform
runtime-version: '50'
sdk: org.gnome.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.rust-stable
command: lambdock
finish-args:
  - --socket=wayland
  - --share=ipc
  - --filesystem=host
  - --device=dri
  - --env=GDK_BACKEND=wayland
copy

The SDK extension is how Rust gets into the sandbox, because the GNOME SDK does not carry it. The finish-args are the permission list, and every line is a decision: Wayland and IPC are what a dock needs to exist; --device=dri is what makes it draw with the GPU; --filesystem=host is broad, and it is a permission a manifest should justify rather than inherit from a neighbouring application. A manifest copied without reading those lines is how a sandbox becomes a formality.

The modules below build the dependencies the runtime lacks – Boehm GC for Guile, then the program – and the AppStream metadata carries the version the release task writes, so the software centre and the recipe agree about what is installed.

Guix and Nix are packaging too  #

The two I use daily are also packages, and treating them as a separate universe is a mistake. guix.scm is a package definition, manifest.scm is an environment, and a Guix channel is a distribution of its own with an authenticated history. A Nix flake exposes packages, apps and devShells, and nix profile install is an installation.

What changes is who does the work. For Debian, Arch and the rest, I write the file layout, the dependency list and the post-install check. For Guix and Nix, the build system does most of the layout, and my job is to describe the inputs and the phases accurately. The distribution recipes still matter, because most users are not on either, and because writing them is what proves the program can be installed without my machine’s habits.

The previous post covers those two files in detail. The packaging lesson here is that they are the same kind of artifact as the .spec and the PKGBUILD: a description of how to get from a source archive to a working program, kept in the repository, reviewed with the code it packages.

What a packager knows that a developer does not  #

These are the habits I would hand to anyone packaging their own software. Most of them were learned by watching a build fail in an environment I did not control.

  • The shebang is part of the interface. #!/usr/bin/env is right for a checkout and wrong for a package with an absolute dependency. Rewrite it, and let the build fail if the interpreter is absent.
  • Ask the tool where its directories are. pkg-config, %{_datadir}, %{_libdir} and the interpreter’s own load path are facts about the target, not about your laptop. Hard-coded paths are the most common “works here” bug in packaging.
  • The build must not use the network. Fetch sources before the build; declare every input. A build that downloads works on the machine with the network and fails on the builder, the CI runner and the distribution’s infrastructure.
  • Do not vendor what you can depend on, and declare what you do vendor. A vendored tree is a licence question and a security question, and both need an answer in the recipe.
  • Install the boring files. Licence, README, changelog, man page, completions, desktop file, AppStream metadata, icons. They are what makes a program feel native in a distribution, and dh_missing --fail-missing, rpmlint and namcap all notice when they are absent.
  • Test the installed artifact. A build-time unit test is not an installation test. Run the installed binary, in a temporary directory, with the development environment’s variables cleared.
  • Do not silently patch upstream. If a change is needed, carry it as a patch with a header that says why, and send it upstream. A distribution that has to maintain a private fork of your build is a distribution that will eventually drop the package.
  • Say what you did not test. A recipe that has never been built on a clean chroot is a draft. The honest README line is “tested on X”, not “supports all distributions”.

The release loop  #

All of this meets in one loop, and the loop is the reason to automate the parts that can be automated:

  1. Write the version in the version source, and cut the release with maak release. The task writes the copies, the changelogs and the spec entry, runs the gate, commits, tags and pushes.
  2. Wait for the forge to publish the tag archive.
  3. Refresh every checksum from the published archive and commit that follow-up. It is the one step no task can know.
  4. Build each format in its own environment: maak deb-build, maak arch-build, maak rpm-build, maak flatpak-build, maak nix-build, guix build -f guix.scm. The tasks are also what CI runs.
  5. Install at least one of the results and run it. A package that builds and does not start is a package that failed.
  6. Publish the recipes with the tag, and let the distributions pick them up. If a package is in a distribution’s repository, the same loop produces the update the maintainer needs.

The loop is deliberately boring. The interesting decisions – the licence, the dependency list, the sandbox permissions, the file layout – are made once, written down in the recipe, and then reviewed like code. That is the whole discipline: packaging is not a chore that follows the software; it is the part of the software that decides whether anyone else can use it.

If you take one habit away: build the package, install it in a clean environment, and run the installed program before you tell anyone it is packaged. Everything else in this post is a detail that habit will eventually teach you.

The rest of this series: developing inside Emacs, the Guix and Nix environments the recipes are built in, and the Maak tasks that drive every build and release.

Sunday, December 6, 2026

How I automate every project with Maak

Every repository I keep has one file in its root called maak.scm, and that file is the project’s control plane. It builds, tests, lints, formats, serves, deploys, packages, releases and writes documentation. If a command matters to the project, it is a task in that file; if it is not in that file, it is a command somebody remembers, which means it is a command that will be forgotten.

Maak is a task runner à la Make whose task list is a Guile Scheme module. That one sentence is the whole design. Every procedure in the file is a task, its docstring is the task’s documentation, its lambda list is its argument grammar, and its body is Scheme. There is no configuration language to learn and no second language to quote things in.

This post is about how I use it, what the tasks look like after a few years, and the rules that keep a task file from becoming a second codebase.

A task file is a module  #

The smallest Maak file that does something has three parts: a module declaration, a task, and a default task that lists the rest.

( define-module ( maak)
   #:export (build test default)
   #:declarative? #t
   #:use-module (maak maak))

( define ( build)
   "Compile the program."
  (run (list  "make"  "-C"  "src")))

( define ( test)
   "Run the test suite."
  (build)
  (run (list  "make"  "-C"  "test")))

( define ( default)
   "List the tasks this project defines."
  (list-tasks))
copy

Then:

maak
maak build
maak test
copy

#:export is the task list. When a module exports nothing, every procedure in the file is a task, which is convenient while a file is young. Once the file has helpers, the export list becomes the boundary: exported procedures are tasks, everything else is a private helper that the CLI never shows. I use the strict form in every project that has more than a handful of tasks, because a helper that appears in maak --list is a helper somebody will run with the wrong arguments.

#:declarative? #t is Guile’s promise that the module can be compiled and loaded in either order, which is what makes startup cheap. The file is a module, so Maak can also read it rather than run it: --list names the tasks and their docstrings, --plan shows the commands a task would run, --dry-run shows them and runs nothing, --completion bash prints a completion script from the same list. A file somebody is halfway through writing still answers questions about itself. That is the property I missed most in every other task runner.

Tasks compose like procedures  #

A task calls another task the way a function calls a function:

( define ( check)
   "Run every check the project has: the linters, then the tests."
  (lint)
  (test))
copy

That is the whole of maak check in the site’s repository. It is not a dependency graph, not a list of names in a shell script, and not a CI file that has to be kept in step with a second CI file. It is two calls, and both are ordinary Scheme, so a task can also branch, loop, map over a list, or read a file before deciding what to do.

The composition is where the design earns its keep. maak test runs the Emacs ERT suite and then the TypeScript tests. maak lint runs the CSS linter, loads the build script in a batch Emacs, and type-checks the TypeScript. maak check runs lint then test. Each of those is a sentence in a file that a reader can follow without a diagram.

The tasks every repository grows  #

After a few projects the shape settles. These are the ones I reach for first:

Task What it does
fmt Formats the source: guix style for Scheme, an indenting batch Emacs for Elisp, the project formatter for the rest.
lint Runs every linter the project has, without changing anything.
test Runs the test suite, or the suites: unit, integration, rendered pages.
check Lint then test. This is the gate a commit has to pass.
build Produces the artifact: a binary, a site, a package.
serve Serves the built artifact locally, after killing whatever was on the port.
hot-reload / dev Watches the source and rebuilds on change.
deploy Publishes the artifact where it belongs.
release The whole release ritual: version, notes, gate, commit, tag, push.
deb-build, arch-build, rpm-build, flatpak-build, nix-build Builds one distribution’s package.
keys-update, modules-update, stats Writes or refreshes a generated document.

There is a pattern in the right-hand column that took me a while to see. The tasks that check a thing and the tasks that write it are usually the same program with a flag. maak keys reads the configuration’s key tables and fails on an inconsistency; maak keys-update runs the same check with HEKS_KEYS_WRITE=1 and writes the reference. maak modules and maak modules-update are the same pair. maak doctor and maak doctor-update are the same pair. The document is an output of the same code that validates it, so the answer to “the manual is out of date” is never “edit the manual”.

argv, not shell strings  #

The most important rule in the file is that a command is a list of arguments:

( define ( serve)
   "Run HTTP server serving the rendered production result of running."
  (kill-server)
  (run (list  "darkhttpd"  "./public"  "--port"
             (~  "~a" http-port))))
copy

run takes an argv list. There is no shell in the middle, so a path with a space stays one argument, a file named $(rm -rf /) is a file name rather than a command, and the command in the source is the command that runs. The alternative – building a string and handing it to sh -c – is how a build script acquires a quoting bug that only appears on somebody else’s machine.

When a task genuinely needs a shell, it says so and explains why. The clearest example is a pipeline:

( define ( add-libs)
  (delete-file-recursively  ".ccls")
   ;;  A pipe and an append-redirection, so this is one of the lines that needs a
   ;;  shell.  Every part is a word of it, and `tr''s second set is the `\n'
   ;;  escape the shell hands over as a newline character.
  (time-machine-manifest-shell
   (append (list  "pkg-config"  "--cflags")
           (string-split (c-packages) #\space)
           (list  "|"  "tr"  "' '"  "'\n'"  ">>"  ".ccls"))
    #:verbose? #t)
  (cat  ".ccls"))
copy

The comment is the pattern: a shortcut with a known limit gets a sentence saying what the limit is and why it is acceptable. The same rule is written into the repository’s AGENTS.md: pass argument lists, never assemble a shell string out of data. It is one of the few rules that is easier to follow than to explain, because run with a list is shorter than the quoting.

The release ritual  #

Release engineering is where a task runner either pays for itself or becomes a pile of half-remembered commands. Mine is one task, and the interesting part is the configuration above it. This is from Lambdock:

( define  package-name  "lambdock")

( define  version-source  "package.nix")
( define  version-source-pattern
   "version[ \t]*=[ \t]*\"([0-9]+\\.[0-9]+\\.[0-9]+)\"")

( define  version-copies
  '(
    ( "data/org.jointhefreeworld.lambdock.metainfo.xml" .  ")
    ( "packaging/arch/PKGBUILD" .  "pkgver=([0-9]+\\.[0-9]+\\.[0-9]+)")
    ( "packaging/opensuse/lambdock.spec" .  "Version:[ \t]+([0-9]+\\.[0-9]+\\.[0-9]+)")
    ( "packaging/voidlinux/template" .  "version=([0-9]+\\.[0-9]+\\.[0-9]+)")
    ( "rust/Cargo.toml" .  "\\[package\\][^[]*version = \"([0-9]+\\.[0-9]+\\.[0-9]+)\"")))

( define  changelog-file  "NEWS.org")
( define  debian-changelog-file  "packaging/debian/changelog")
( define  spec-file  "packaging/opensuse/lambdock.spec")
( define  release-gate '( "test"))
copy

The version is written by hand once. Every other file that cannot read it carries a copy, found by a regular expression rather than a line number, and only the captured span is rewritten, so each file keeps its own alignment, quoting and wording. A pattern that stops matching is reported instead of silently checking nothing.

Then maak release 2.3.12 "The dock remembers its shelf across restarts." does the rest:

  1. Refuses to run on a dirty worktree, so the release commit is the release and not everything in progress.
  2. Writes the version into the version source and every copy.
  3. Writes the release notes into the Org changelog and the Debian changelog, and inserts an entry into the RPM spec’s %changelog with a C-locale date, so rpm -q --changelog reads the same everywhere.
  4. Refuses a version whose tag already exists.
  5. Runs the gate – maak test – and does not commit if it fails.
  6. Commits chore: Release vX.Y.Z, tags it with an annotated tag, pushes the branch and the tag, and opens the release on the forge unless the tag workflow publishes it instead.

What is left for a person is the checksum. The archive is published by the forge after the tag is pushed, and no task can know the hash of a file that does not exist yet. So the recipe’s checksum is refreshed from the published archive afterwards, and that step is written down as the one thing the ritual cannot do. Pretending otherwise would be the kind of automation that is wrong exactly once per release.

The same ritual exists in every repository, with the variables changed. That is not copy-paste for its own sake: the configuration block is a few dozen lines that say what this repository calls things, and the machinery below it is identical. When I fix a bug in the machinery, I fix it in one place and copy the fixed block; when a project’s layout differs, only the configuration differs.

Package builds are tasks too  #

The distribution recipes live in packaging/, and the commands that drive them are tasks. Lambdock’s are a good tour because the project ships every format:

( define ( deb-build)
   "Build .deb package (unsigned)"
  (dsl:run (list  "apt"  "update")  #:sudo? #t  #:verbose? #t)
  (dsl:run (append (list  "apt"  "install"  "-y") (deb-packages))
            #:sudo? #t  #:verbose? #t)
  (dynamic-wind
     ;;  Setup: create temporary symlink at project root
    ( lambda () (ln-s  "packaging/debian"  "debian"  #:force? #f  #:verbose? #t))
     ;;  Execution: run debian build commands against ./debian
    ( lambda ()
      (dsl:run (list  "mk-build-deps"  "-i"  "-r"  "debian/control")
                #:sudo? #t  #:verbose? #t)
      (dsl:run (list  "debuild"  "-b"  "-uc"  "-us")  #:verbose? #t))
     ;;  Cleanup: remove symlink safely (leaves packaging/debian intact)
    ( lambda () (rm-rf  "debian"  #:verbose? #t))))
copy

The dynamic-wind is the interesting part: the package directory has to be at the repository root while Debian’s tools run, and the symlink has to be gone afterwards even if the build fails. That is what dynamic-wind is for, and it is a better answer than a trap in a shell script because it is the language’s own guarantee about the cleanup.

arch-build runs makepkg and then namcap on the PKGBUILD. rpm-build builds a source tarball with git archive at the tag, puts the spec where rpmbuild expects it, builds the binary and source RPMs, and runs rpmlint on both. flatpak-build installs the runtime and builds the manifest. nix-build and nix-test go through Maak’s Nix helpers. Every one of them is a task a person can run, and every one is the same command CI runs.

The environment is part of the task  #

A task that needs a tool should name the environment that has it, not hope the machine does. Maak’s Guix helpers make that the default:

( define ( js-tool name)
   "Return the path to the pinned NAME, installing the tools on first use."
  ( unless (file-exists? (string-append  "node_modules/.bin/" name))
    (js-run (list  "npm"  "ci"  "--no-audit"  "--no-fund")))
  (string-append  "node_modules/.bin/" name))
copy

js-run is the time-machine-manifest-shell call from the previous post. The effect is that maak lint-js does not care whether the machine has Node, and maak build does not care whether it has the right Emacs. The environment comes from the tree, the task says what command to run inside it, and the two are reviewed together.

There are helpers for the other direction too. run-pipeline captures output and reports failure without throwing; capture returns a string; git-output and its friends answer questions about the repository; home-dir, remkdir-p, rm-rf, cp and ln-s do the file operations a script would otherwise spell with mkdir -p and rm -rf. A task file that uses them reads like a description of what should happen rather than a transcript of shell commands.

Documentation as an output  #

The habit that changed how I work is treating documentation as a build artifact. heks-emacs is the clearest case: maak keys-update writes the keybindings reference from the key tables, maak modules-update writes the module table from the module declarations, maak doctor-update writes the programs the modules expect into the installation page, and maak stats refreshes the numbers in the README. Each has a checking twin that fails when the document and the code disagree.

The rule generalises: if a document can be derived from data, derive it. If it cannot, write it by hand and put the hand-written part somewhere the checks can see. The worst outcome is a document that is almost generated – close enough to look authoritative, stale enough to be wrong.

Two more generated artifacts are worth naming because they are unusual:

  • maak agents writes AGENTS.md from two pinned skill files (fetched at a commit, not from a branch) and the practices written in maak.scm. Regeneration is deterministic: the same pins and the same text produce the same file, byte for byte. The file says so at the top, and says that the task is the thing to edit.
  • maak themes renders one sample document in every installed palette into a single HTML page, so choosing a theme is a comparison rather than a sequence of load-theme calls. A report is a legitimate build output.

Neither of those is necessary to build the software. Both make the project easier to work on, which is the difference between automation that saves typing and automation that saves thought.

CI is the same task  #

The CI configuration should be a caller, not a second implementation. In the Guix channel the Woodpecker job names the tasks:

  • maak check-formatting asks the formatter to check rather than write, because maak fmt rewrites the tree it is judging and therefore cannot fail on a file nobody formatted.
  • maak check lints offline, builds every package in the pinned Guix revision, and authenticates the channel’s history.

Formatting comes first so a red build names the cheapest thing first. The job definition is short because the work is in the task file. When a check changes, it changes in one place, and the next CI run is the proof.

The same principle applies to the site: its deployment is maak deploy, and maak deploy is maak build plus the copies that publish the result. There is no separate “production build” that differs from the development build in ways nobody remembers.

What Maak is not  #

It is not a build system with a timestamp graph. It will not look at your .c files and decide which objects are out of date; it will run the task you named. If a task needs incrementality, the task says how – a compiler’s own dependency tracking, a hash of the inputs, a marker file – and the task’s comment says why. This is a feature, not a gap: the moment a task runner guesses what is stale, it also guesses wrong, and the failure is a build that silently skipped the thing you changed.

It is also not a package manager and not an environment manager. Those jobs belong to Guix, Nix and the distribution, and Maak’s job is to call them with the right arguments in the right order.

What it is: a place where a project’s operational knowledge lives in a language that can express it, with documentation attached to every task, and a CLI that can explain the file without running it. For the kind of projects I keep – libraries, GTK4 programs, static sites, a Guix channel – that is exactly the right size.

Getting started  #

A first task file needs one module and one task:

( define-module ( maak)
   #:use-module (maak maak))

( define ( hello name)
   "Greet NAME."
  (log-info  "hello ~a" name))
copy
maak hello world
maak --list
maak --plan hello world
maak --completion bash
copy

Task arguments arrive as strings, because they came from a command line. A task that does arithmetic converts them:

( define ( quick-math x-arg y-arg)
  ( let* ((x (string->number x-arg))
         (y (string->number y-arg)))
    (format #t  "~a + ~a = ~a" x y (+ x y))))
copy

From there, add the tasks in the order you actually run them. Start with check, because a gate you run is worth more than ten tasks you forget. Add release when the first tag hurts. Add the package builds when a distribution recipe exists. And resist the urge to add a task for every command: a task file that mirrors the shell’s history is a task file nobody reads.

The one habit I would keep above all others is the pair. Every generator gets a checker, every checker gets a generator where one is possible, and maak check runs the checkers. That is what makes the file a control plane rather than a scrapbook, and it is the reason I trust the projects to a single Scheme file at all.

The rest of this series: developing inside Emacs, the Guix and Nix files these tasks run inside, and packaging the results for the distributions.

Sunday, December 6, 2026

Saturday, December 5, 2026

jointhefreeworld

Olive CSS: Tailwind’s class names, a Lisp engine, no JavaScript

Olive CSS generates a utility-class stylesheet from a Guile program. You write the class names you already know from Tailwind, and one plain CSS file comes out.

I wrote it because I was tired of installing a JavaScript toolchain to produce a file whose entire job is to contain CSS. The generator is a Guile library, so a build is a function call with the colours, breakpoints and variants you want, and everything between the palette and the stylesheet is code I can read.

Tailwind’s syntax, a Lisp engine, Vanilla CSS and a utility class stylesheet you own.

The source is at https://github.com/jjba23/olive-css under the MIT licence, the API reference is at https://jointhefreeworld.org/api-docs/olive-css/index.html, and the guide lives in the repository’s docs/ directory.

I’ve spent most of this year on it, and it now builds the stylesheets for everything I run. In September it was a README, a script that wrote a stylesheet and a second script that pruned it. The class names haven’t changed since. What changed is how much of the pipeline became something a project could call, extend and complain about.

The Olive CSS logo: an olive branch between two curly braces



What it looks like  #

Nothing new in the markup, if you’ve used Tailwind:

< div  class= "group m-2 px-4 py-6 bg-jeans-blue-500
            md:bg-asparagus-300 hover:bg-tawny-700">
  < span  class= "text-white font-bold font-serif group-hover:text-tawny-700">
    Hello Olive CSS!
  span>
div>
copy

Five of those classes become these rules, copied out of a build this repo ships:

 .px-4{ padding-inline:1.12rem;}
 .bg-jeans-blue-500{ background:oklch(0.452 0.0712 256.28/1);}
.hover\:bg-tawny-700:hover{ background:oklch(0.5683 0.1557 45.26/1);}
.group:hover .group-hover\:text-tawny-700{ color:oklch(0.5683 0.1557 45.26/1);}
 /*  and, inside @media (width >= 48rem) { ... }  */
.md\:bg-asparagus-300{ background:oklch(0.6512 0.0882 137.17/1);}
copy

A class name gets escaped the way CSS escapes a name. A colour is an oklch() triple, so the shades of a palette stay perceptually even instead of drifting the way hand-picked hex values do. Breakpoints are media queries with range syntax, hover rules are flat, and the dark theme is one :where([data-theme=dark], [data-theme=dark] *) scope with every dark: rule inside it. No @supports detection, no custom property for every declaration, no polyfill.

None of that is exotic CSS. It’s just that a generator has to get it right for every family in the framework, and it’s a good sign when what it printed is what you’d have written by hand.

Two programs, one stylesheet  #

The generator has no idea which classes your site uses, and it isn’t going to parse your templates to find out. It writes everything: every family, every shade, every state, every breakpoint, the container variants, the dark layer. The palette, the variants and the breakpoints are parameters, so a build is one deterministic function of them. That’s why the full stylesheet is several megabytes. Selector-shaped variants, container queries, composed filters and shadows all come out as whole layers, and each layer costs bytes.

The second program is what makes the first one affordable, because nobody downloads the full sheet.

A site’s build runs the pruner over its own output. The pruner imports one module, (olive-css license), for the header it writes, so it never drags in the generator or any of the declaration modules. It does five things:

  1. Walks the directory and reads class names out of whatever the chosen mode understands: class attributes in HTML, (@ (class "...")) in SXML, className={...} in JSX, :class in Vue, class:name in Svelte, hiccup vectors, Elm calls, literal classes in a PHP, Jinja or HEEx template, and a few more.
  2. Escapes each name the way CSS escapes it ( hover:bg-x becomes hover\:bg-x, @sm:flex becomes \@sm\:flex) and drops the duplicates.
  3. Parses the stylesheet into nested blocks instead of matching lines, so a rule inside @media, @container, @supports, @layer or the dark scope is nested rather than a line that happens to contain a dot.
  4. Keeps a rule when a selector in it reaches a used class, keeps the rules with no class at all (the reset, @keyframes), and drops a grouping block that ends up empty.
  5. Writes the result minified, with the same licence header.

On my machine the whole 9 MB build takes about a second to prune:

$ olive-css tree-shake
 Tree-shaking (html mode): 89 classes kept
  resources/css/olive.min.css: 9065114 bytes
  public/olive.min.css: 7153 bytes
copy

Two things about that are worth more than the byte count.

A variant can put two class names in one selector, like .group:hover .group-hover\:flex, and only the utility class is matched. So a page that uses group somewhere doesn’t drag every group-hover rule along with it.

And a class the pruner can’t enumerate is a class it can’t keep. That’s the real reason there are no arbitrary values in this framework: w-[13px] has no finite list to generate, so it would be the one class the pruner couldn’t answer for. I’d rather not ship the exception, and it’s the first item under What it doesn’t do.

When the class name is built at run time  #

A template that assembles a name from data, (string-append "text-" colour "-500"), can’t be scanned, because the name isn’t in any file. Two parameters cover that, and they compose: preserved-classes keeps names as written, preserved-patterns keeps a family by regular expression.

(use-modules (olive-css tree-shaking))

( parameterize ((artifact-path  "_site")
               (scan-mode 'manifest)
               (preserved-classes '( "bg-onyx-900"  "text-floral-white-100"))
               (preserved-patterns '( "text-.*-500")))
  (tree-shake))
copy

What it saves  #

Six sites, each one’s whole source tree scanned, and the stylesheet this repo generates for it pruned:

Application Classes Stylesheet Pruned
wikimusic 503 3.80 MB 16.1 KB
lucidplan 358 3.80 MB 14.5 KB
byggsteg 254 3.87 MB 12.8 KB
torikomi 144 3.97 MB 7.5 KB
carvoeiro-water-fun 239 4.49 MB 6.7 KB
iter-vitae 201 3.80 MB 6.6 KB

The scan includes each project’s tests and documentation, so those are upper bounds. They count names rather than rules, and the prune keeps every rule a name reaches: a shade, its opacity modifiers, its states, its variants. The method behind the table, and how to reproduce it, is in the tree-shaking guide.

Bar chart of the pruned stylesheet size for six sites, from 6.6 KB to 16.1 KB
What a browser downloads, after pruning. The same stylesheets as generated are 3.80 to 4.49 MB, so the largest bar here is about 230 times smaller than the input it came from.

WikiMusic, and the afternoon the pruner cost me  #

WikiMusic is a free music knowledge encyclopaedia: songs, artists and genres, with guitar and bass tabs, chords, lyrics, keys, tunings and sheet music, written by musicians for anyone learning to play. It’s a Guile application on GNU Artanis, and its views build markup with mk-class:

(class ,(mk-class '(h-16 w-auto)))
copy

That shape is the reason the scheme scan mode exists. It reads every quoted list inside a call to mk-class, follows the call into its own cond and append branches, and reads SXML attributes too. Point it at the sources and the prune needs no rendering and no browser.

Then it got interesting. WikiMusic hands classes to more than one helper: a framework component takes them as #:extra-classes '(...), and one of its own helpers takes a quasiquoted list built around a variable. The mk-class reader saw none of those, so the prune dropped their rules. The site still rendered a page. It rendered one with no gutter in the footer, no ink on a link and no colour behind the page, and it took me an embarrassing afternoon to notice.

The fix is the extension point I’m most pleased with. scan-extractors takes procedures, each one from a file’s text to class names, and runs them next to the mode’s own readers. WikiMusic’s reader takes every quoted list in a file, using Guile’s read instead of a regular expression:

 ;;  shortened: `quoted-classes' and `datum-classes' recurse into the datum.
( define ( quoted-class-lists text)
   "The class names every quoted list in TEXT names."
  ( let  loop ((port (open-input-string text))
             (found '()))
    (catch #t
           ( lambda ()
             ( let ((form (read port)))
               ( if (eof-object? form)
                   found
                   (loop port (append (quoted-classes form) found)))))
            ;;  A file the reader cannot finish -- the scripts under `pub/js' are
            ;;  not Scheme -- keeps what was read of it: a name kept by mistake
            ;;  costs a few bytes, a name missed paints nothing.
           ( lambda (key . args) found))))
copy

A reader rather than a pattern, because a class list nests in the row it belongs to ( '(500 warning (text-redwood-700 dark:text-redwood-300))), and because only a reader tells a word inside a string or a comment apart from a class. A file that won’t read to the end, like the JavaScript under pub/js, keeps whatever was read of it: a name kept by mistake costs a few bytes, and a name missed costs a colour.

The scan also covers the framework modules the views build markup with, hygguile and kracht and orgwebalchemy, because a component names classes of its own ( sr-only, animate-spin, hidden, the ink a button takes on hover) that no view names again.

The pruner also checks  #

Reading every quoted list makes the report noisy, since a quoted list also holds a status code, a locale or a route path. So WikiMusic builds its report from a narrower reading, the names a view hands to mk-class or writes in a class attribute, and asks two questions of them.

undefined-classes
every name no stylesheet defines. Most turn out to be hooks a script reads, icon names, or the framework’s own inline sheet. The count gets printed.
unsupported-steps
names that ask for an opacity step the generator doesn’t produce. Only a handful of steps exist, and a class like bg-redwood-500/15 paints nothing at all: no rule, no error, a page quietly missing a tint.

The second one fails the build and names the class. It’s about forty lines, and it’s the olive-css check command the roadmap still lists as not built. That’s the argument for making the pruner a library instead of a tool: a project can ask its own questions about its own output without waiting for me to invent a verb for them.

What WikiMusic serves  #

The generated stylesheet is 3.8 MB. The pruned file the instance serves is 23 KB, checked in, because it’s what the site links. It sits beside 76 KB of the project’s own CSS, and the two together are what a page waits for.

The gap between 16.1 KB in the table and the 23 KB it really serves is the reader. WikiMusic reads every quoted list, so it keeps rules for classes its components name and no view repeats. Reading more names keeps more rules, which is the direction I want the error to go in.

WikiMusic's genre list: a responsive grid of illustrated tiles, each naming a genre
The genre list at wikimusic.jointhefreeworld.org. The tiles, the hairlines, the pink button and the grid that reflows on a narrow screen are utility classes in the views; the project's own stylesheet paints the palette and the type over them.
The top of a WikiMusic song page in dark mode: title, key and tuning chips, artwork, and the metronome controls
The same stylesheet with data-theme="dark" set: the dark layer, not a second build. Chord diagrams, selects and the rest of the controls are drawn with the same utilities.

Why a Lisp  #

Every framework claims to be configurable. The question is what the configuration is made of. In Olive CSS a knob is a Guile parameter, and a build is a parameterize around one function:

(use-modules (olive-css main)
             (olive-css decl colors))

( define  my-project-palettes
  (list (cons 'onyx (onyx))
        (cons 'floral-white (floral-white))))

( parameterize ((with-dark-mode? #f)
               (minified? #t)
               (state-variants '(hover focus))
               (responsive reduced-responsive)
               (responsive-classes (core-utility-classes))
               (palettes my-project-palettes))
  (write-css-to-file  #:file  "my-build.css"
                      #:css-lines (olive-css-gen)))
copy

Run that with guile -L src my-build.scm and you have a stylesheet. There’s no config file to learn and no plugin protocol, because the thing you’re configuring is already a program. The whole surface fits on one table in docs/customization.org.

A colour is three numbers. make-palette takes an oklch triple, derives the five shades, and every family that mentions a colour picks the new one up:

(use-modules (olive-css dsl)
             (olive-css main))

( define  my-colour (make-palette '(0.62 0.15 250)))

( parameterize ((palettes (append (palettes) (list (cons 'my-colour my-colour)))))
  (write-css-to-file  #:file  "my-build.css"
                      #:css-lines (olive-css-gen)))
copy

After that, bg-my-colour-500 exists, and text-my-colour-300/50, and the ring, outline, accent, caret, fill and stroke forms, because those families read the palette instead of repeating it.

That shape has done more work than I expected:

  • The tree-shaker’s readers are data plus procedures. A mode names a shape, and a build with a shape no mode knows passes a procedure. The extension WikiMusic needed wasn’t a patch to a framework, it was a function in its own build script.
  • The CLI is importable and returns a status instead of exiting. The tests drive the same entry point a build script does: (run-cli '("generate" "--build" "lucidplan")) answers 0.
  • The scales are values, not prose. sizes.scm holds the t-shirt steps, numeric steps, fractions, trackings and alphas, and every family reads that list instead of restating its steps, so changing a multiplier changes the framework coherently.

The cost is honest: to change a family you have to be willing to read Scheme. If all you want is class names, that cost buys you nothing and the defaults are for you. The source is for the day the defaults aren’t enough, and it’s why the answer to “can it do what my design needs” is usually a small diff in one module rather than a fork.

Compared to Tailwind  #

Tailwind is a serious piece of software, and a framework that borrows its vocabulary owes it a straight comparison.

  Tailwind CSS Olive CSS
What you install a JavaScript package, or its standalone CLI a Guile library and its command
How classes are found the tool parses your source files the pruner reads built output, or the sources, or a list you declare
Arbitrary values yes: w-[13px], content-['x'], [&>svg] no
Configuration a CSS-first file, with a JavaScript hatch parameterize around a function
Reproducible build the Node toolchain Guix, bit for bit
Licence MIT, with a paid UI kit beside it MIT throughout

They aren’t competing on the same axis. Tailwind’s generator reads your source files and produces classes on demand, but it ships as a JavaScript package (with a native CLI beside it), so adopting it means adopting a toolchain and a version to keep in step with everything else in your front end. Olive CSS generates everything once and prunes the output, which is why it can read HTML, SXML, JSX, hiccup, Elm, PHP or a declared list in the same pass, and why no part of your build has to be JavaScript.

On parity I’d rather be precise than generous: by the project’s own count, an unweighted average over the core utility families, most of Tailwind v4’s surface is covered, and the weak spots are written down in docs/comparison.org instead of being rounded up. SVG is the thinnest family. Arbitrary values are missing entirely.

So pick Tailwind if its ecosystem is the point, if arbitrary values are load-bearing in your design, or if you want a component kit with a support contract. Pick Olive CSS if you want a stylesheet you can read end to end, a build that’s a program you own, and a served file measured in kilobytes instead of in a build log.

Native CSS is enough now  #

The output is plain CSS because plain CSS caught up: oklch() for colour, container queries for components that respond to their box instead of the viewport, :has() and :where() for selectors that used to need a class in the markup, range syntax in media queries. What the browser was missing wasn’t a feature. It was a vocabulary: a scale of names a designer, a template and a stylesheet can agree on, plus a way to keep only the part a site uses.

A site that uses Olive CSS has a make target that regenerates one file, and that’s the whole build. No watcher to restart, no plugin to re-audit, no bundler integration to repair after a major version. That’s the part that ages well.

Learning it, and hacking it  #

If you know Tailwind, you already know the class names, the variants and the order of md:group-hover:. What you have to learn fits on a page, and it’s all differences: max-w-sm names a container width instead of a spacing step, arbitrary values are absent, a stacked variant is one entry in stacked-variants instead of a free combination, and the colours are this project’s own (onyx, jeans-blue, asparagus, tawny), to use or replace.

For the generator, the entry point is small. A utility family is one module under src/olive-css/decl/, its tests go in one file, and the vocabulary it draws from is a list in sizes.scm. Adding a family means writing the rules you want and letting the existing scales, palettes and variants apply to them. That’s how it grew from a handful of areas to nineteen in a year without turning into a pile of special cases.

The second kind of hacking is the one I didn’t plan for: changing what the pruner knows. scan-extractors and class-call-names came out of projects asking for them, because a reader is just a procedure from a file’s text to class names. If your markup has a shape the shipped modes don’t cover, you don’t open an issue and wait for me. You write a few lines and pass them:

( define ( marked-classes text)
   "The classes TEXT names after a `data-classes:' marker."
  ( let ((at (string-contains text  "data-classes:")))
    ( if at
        ( map escape-class-name
             (string-tokenize (substring text (+ at 13))))
        '())))

( parameterize ((artifact-path  "src")
               (scanned-file-types '( ".tpl"  ".conf"))
               (scan-extractors (list marked-classes)))
  (tree-shake))
copy

What it doesn’t do  #

The repo keeps a list of what it can’t do, and it’s worth reading before you decide anything:

  • Arbitrary values. w-[13px], content-['x'], [&>svg]. A static generator can’t enumerate them, and a class it can’t enumerate is a class the pruner can’t keep. There’s a design for one small, recognised shape. It isn’t built.
  • Stacked variants by default. md:group-hover: exists, one entry per combination in stacked-variants, because each combination costs its product in bytes. The machinery is there. The cross-product is a budget question.
  • Mask colour stops and stroke-dasharray. Two small gaps in families Tailwind has.
  • Cascade layers. The pruner understands @layer blocks, the generator doesn’t emit them yet, so a site’s own CSS still needs the usual specificity care.
  • olive-css check and olive-css size. The pruner already scans and already knows every selector it kept, so both are reporting modes rather than new machinery. WikiMusic wrote the first one in its own build script. The second would put a byte count on every release.

None of that is a promise with a date.

Try it  #

From a checkout:

guix time-machine --channels=channels.scm -- shell -m manifest.scm -- maak build
./bin/olive-css generate --build full --output app.css
./bin/olive-css tree-shake --directory public --output app.min.css
copy

There are install routes for Guix, Nix, a container, and Debian, openSUSE and Arch recipes under packaging/; the Guix one needs the guix-jointhefreeworld channel checked out beside the project. The four install routes and a first page are in docs/getting-started.org.

If you find a class that paints nothing, a name the pruner misses, or a family you’d rather have written yourself, that’s the kind of report this project is built to act on. The backlog is at https://lucidplan.jointhefreeworld.org/tickets/olive-css.

Closing  #

A stylesheet is one of the few things on a web page you can still read all the way down: rules, selectors, values. Having a generator in front of it isn’t a problem. Having a black box in front of it is. This year’s work was making that box less opaque: a build I can call from a Scheme prompt, a pruner that tells me which classes it kept and which names nothing defines, and a served file I can account for line by line.

So it isn’t that Lisp makes CSS faster, and it isn’t that a framework should be a language. It’s that a framework you can rewrite is a better neighbour to a browser than one you can only configure.

If you’ve been meaning to drop the toolchain from a project and haven’t found the excuse yet, try it and tell me what broke.

Saturday, December 5, 2026

Friday, December 4, 2026

Scheme Requests for Implementation

SRFI 266: The expr syntax

SRFI 266 is now in final status.

The syntax expr allows Scheme programmers to write arithmetic expressions using a syntax similar to mathematical notation, potentially improving the readability of Scheme programs.

by José Bollo at Friday, December 4, 2026

Thursday, December 3, 2026

jointhefreeworld

Sift: the Lisp formatter I kept trying to write (+lint +LSP)

sift is one Guile program: a formatter, a linter and a language server for Scheme, Racket, Emacs Lisp and Common Lisp. It has 95 rules, formatting is idempotent, and it runs in your editor, your terminal, CI, a container and a browser tab.

I’ve been writing Lisp for a few years, and for most of that time my tooling was a pile of workarounds. Two editors disagreed about indentation. CI formatted the code one way and my editor another. A compiler warning was prose: no stable code, no severity, no JSON, no way to suppress it next to the line that caused it, no fix. A repository with Scheme, Emacs Lisp and Common Lisp needed three tools, three configs and three CI steps. sift is the first thing I’ve built that reads the file instead of guessing at it.

This is the program I’ve been trying to write for years. I finally got it.

Find sift at https://github.com/jjba23/sift, and try it in your browser at https://jointhefreeworld.org/sift/.

sift lint, fix and format in a terminal, then the same file in Emacs
sift lint, sift fix --write, the formatter's diff, and the same file in Emacs with Flymake, Eglot and formatting. Recorded from a checkout.


The problem  #

Lisp is a tree of nested lists. The language knows it; most of the tooling around it pretends otherwise, sometimes with regex.

Go has gofmt and Rust has rustfmt: one program, the same answer on every machine. In the Lisp world the answer is usually “my editor does it”, “the compiler warns about it”, “we have a fmt task somewhere”, or “run guix style on the package file”. Those are local opinions, some with a batch mode.

That was my situation. My projects are Guix and Guile, Emacs Lisp and a little Common Lisp; Racket is the fourth dialect sift grew into. Formatting was a maak fmt task running guix style on every .scm file and Emacs’s indent-region on every .el file. Linting was checkdoc, the byte-compiler, guild compile -W3, guix lint, stylelint, and a hand-written checker that read every .el form to prove the config still loaded. Each tool was good at its slice. None of them was the thing I wanted, and they disagreed at the boundaries.

The failed attempts  #

I didn’t design sift in one go. I kept solving the problem with the tools I had, and each attempt taught me one piece.

The keyboard macro  #

Tabs to spaces, trailing whitespace gone, indent-region, save, stare at the diff. Then a sed script. It felt like magic for about a day, until I hit a form whose indentation depended on what the form meant. The mechanical part is easy. The structural part is the whole problem.

Emacs in batch  #

The obvious next step was Emacs’s own indentation engine over the whole tree. I had a file called batch-indent.el:

( defun  indent-file ( &optional save)
   "Format the whole buffer."
  (indent-region (point-min) (point-max) nil)
  (untabify (point-min) (point-max))
  (delete-trailing-whitespace)
  ( when save
    (save-buffer)))
copy

Lisp indentation is structural, and the modes encode decades of convention, so for a while this felt like a formatter. But the answer depends on scheme-mode, Geiser, the project’s indent-rules and the Emacs version, so two machines could format the same file two ways and both were right according to their setup. It only indents, so it doesn’t own the printer, isn’t a fixed point, and has no lint, no exit status and no report.

guix style  #

Next I tried the canonical tool where one existed. guix style knows how a package definition should look, and it has taste. It also formats package definitions, not Scheme: not my modules, not my SXML, not my general procedures or comments. It reflows, so every new idea about line breaks turns every file into a diff. And the .el files still went to Emacs, which left the repo with two formatters and a boundary where they disagreed. I kept the ambition, and the suspicion that reflowing was the enemy.

The compiler  #

Then I tried to stop writing a linter and use the ones the language already had: checkdoc and the byte-compiler for Emacs Lisp, guild compile -W3 for Scheme, guix lint in Guix buffers, plus a small checker that read every .el form and compared the module list in init.el with the files on disk:

( while ( progn (forward-comment (point-max)) (not (eobp)))
  (read (current-buffer)))
copy

This taught me the most important lesson of the bunch: the language’s own reader and compiler know more than any regex. A file that doesn’t read is a finding. A docstring that doesn’t name its arguments is a convention the byte-compiler cares about. lexical-binding isn’t taste; it’s a header the file needs.

But read throws away the evidence. It discards comments, keeps no positions, and can’t represent a block comment, a datum comment or a reader prefix as a node.

The pretty-printer  #

Once the tree worked, I thought the next step was a pretty-printer that decided line breaks from structure, the way Prettier does. The output was beautiful. Then I ran it on a 300-line file and the diff touched every line. git blame stopped working, and every future change would be buried under the formatter’s opinions. I reverted the file and never wrote that pretty-printer again. That’s where the no-reflow rule comes from.

read plus a scanner  #

Before I wrote the reader, I tried to build the linter on Guile’s read plus a line scanner: read gave me forms, the scanner gave me lines, and a table mapped one to the other. Comments fell through the table. A comment inside a form, a #; datum comment, a string with a semicolon in it: the two representations disagreed and I couldn’t tell which one was right. I gave up and wrote the reader. One representation has to win, and it has to carry positions.

The pre-commit hook  #

I wired guix style and emacs --batch into a pre-commit hook. It was fast and useful, and it caught tabs and trailing whitespace before they landed, but it only caught what those tools caught, it couldn’t fix anything, and every repository had its own copy. The pipeline shape was right. The tool behind it was missing.

One tool per dialect  #

The obvious next move was one tool per dialect: Racket’s formatter for Racket, guix style for Scheme, Emacs for Elisp, something else for Common Lisp. It worked, in the sense that each dialect got a tool. It gave me four tools, four configs, four CI steps and four styles that disagreed at the boundaries.

What it is  #

One executable  #

sift format [OPTIONS] [FILE...]      #  print the formatted file
sift lint [OPTIONS] [FILE...]        #  report findings
sift check [OPTIONS] [FILE...]       #  print the patch, exit 1 if any
sift fix [OPTIONS] [FILE...]         #  lint --fix
sift ci [OPTIONS] [FILE-OR-DIR...]   #  format check + lint, never writes
sift lsp                             #  a language server on stdin/stdout
sift doctor                          #  what ran, what it read, what it decided
sift list-checkers [--dialect D]     #  the catalogue as a table
sift explain RULE                    #  one rule's reasoning
sift config show|explain|trust ...   #  the settings, and which layer won
sift install-hooks [--force]         #  a pre-commit hook that runs `ci'
copy

Status 0 is clean, 1 is findings, 2 is a usage error or a file that can’t be read.

The dialect is explicit ( --dialect), then the extension, then the shebang, then a marker in the first 200 lines: #lang is Racket, defpackage is Common Lisp, define-module is Scheme, lexical-binding is Emacs Lisp. If none answers, it says so. It never guesses.

$ cat square.scm
(define (square x)
(* x x))

$ sift check square.scm
--- square.scm
+++ square.scm
@@ -1,2 +1,2 @@
 (define (square x)
 -(* x x))
+  (* x x))
$ echo $ ?
1
copy

check prints the patch and exits 1. It never modifies your files. sift format --write square.scm makes the change, and the next sift check exits 0.

When the environment and the tool disagree, ask the tool:

$ sift doctor
sift 1.41.2
  guile       3.0.11
  library     /home/joe/Hacking/sift/src
  rules       95
  dialects    scheme, racket, elisp, cl

Compilers
  scheme available
  elisp available
  cl not found

Configuration
  project  /home/joe/project/sift.yaml

Settings that are not the default
  brackets: square    #  /home/joe/project/sift.yaml
  severity: warning    #  /home/joe/project/sift.yaml
copy

The formatter  #

Every node carries its source location. Comments, blank lines, datum comments and reader prefixes are nodes, not trivia. A file with one broken form still gets a tree, because a linter that says nothing about a file it couldn’t parse fails exactly when it’s needed.

The reader knows each dialect’s read syntax rather than a compromise: #\a is a character in Scheme, Racket and Common Lisp and ?a in Emacs Lisp; #:key is an uninterned symbol and :key a keyword; #| ... |# nests; #; comments out the next datum; #lang opens a Racket module; a square bracket is a vector in Emacs Lisp and a clause delimiter in Scheme. sift doesn’t average the two.

The formatter does six things: normalise line endings, normalise spacing, place closing delimiters, compute indentation, optionally align inline comments, and preserve blank lines up to the style’s limits. Everything else comes out as written, including line breaks, strings, escapes and comments. Run it twice and you get the same bytes; the suite formats every fixture and then formats the result to check.

Indentation is three rules. A form whose first element is a symbol is looked up in the dialect’s table; a data list or vector aligns under its first element; anything else lines its arguments up under the first argument. That’s the whole algorithm. The tables exist for the forms where structure alone isn’t enough.

Two styles. community keeps closing delimiters trailing, dangling puts each on its own line. Scheme writes cond clauses with square brackets, as Guile and Guix do, and --brackets=parens or --brackets=preserve changes that; Emacs Lisp and Common Lisp keep what they were given. The clause-brackets rule ( SIFT036) reports a file that hasn’t been formatted yet, and its fix swaps the two characters.

It refuses to reflow a long line (the line-length rule warns instead), invent a missing parenthesis, rewrite an expression, or format inside a #; datum comment, a #. form or a #<...> object. sift fix doesn’t reformat, because a fix that moved whitespace would touch every line of the patch it was meant to make readable.

The linter  #

A rule is a record: name, code, description, dialects, default severity, procedure and example. The driver reads the file once, runs the rules the dialect applies to, folds in what the reader reported, honours suppression comments, and sorts the findings by file, line, column and rule. There are 95 rules, each with a stable code ( SIFT001 through SIFT095), assigned by hand and never reused. sift explain RULE reads the reasoning out of the program, and doc/rules.org is generated from the records.

The catalogue, condensed:

Where What it checks
all four whitespace, line length, delimiters, empty bodies, progn, blank lines, comment levels, single-letter names, the if / when / unless family, keyword arguments, complexity
Scheme and Racket internal defines, letrec, quasiquote, clause brackets, docstrings, eta and beta reduction, let simplification
Emacs Lisp docstrings, lexical-binding, interactive, provide, declare, require-cl, save-excursion-set-buffer
Common Lisp package prefixes, double colons, dangling parentheses, LOOP style, identity, ecase-otherwise, mixed-lambda-list
Guix gexps, #$output, with-imported-modules, phase names, sha256, package synopses, inputs
SXML attribute lists, children, empty elements

sift explain if-without-else prints that record: the code, the name, the description, the dialects, the severity, a failing example and the expected fix. A diagnostic and a documentation page are the same data, which is the part I like most.

A rule may carry a fix, which is one range. sift lint --fix applies fixes from the highest offset down, then lints once to show what’s left; there’s no loop. If a fix introduced a parse error the file didn’t have, every fix of that run is discarded and the original findings are reported. A file the reader couldn’t finish is refused, because a fix around a missing parenthesis would be a guess. --force is for a caller who knows better.

Some rules have no fix on purpose. unmatched-parens won’t guess where a ) belongs. wrap-in-let won’t invent a binding name. The naming rules won’t rename anything. blank-line-in-body won’t delete a line. Deciding how to split or name code is your work.

Suppression is a comment, not a config list:

 ;;  sift:disable-next-line keyword-arguments
(make-window a b c d e f g)

 ;;  sift:disable wrap-in-let
( define ( f x)
  ...)
 ;;  sift:enable wrap-in-let
copy

disable-next-line covers the next line, disable covers to the end of the top-level form, and enable ends it. An exception list in a config file is a list no review reaches. This one is in the diff.

Fixing isn’t filtered by severity. severity: warning says what fails a build, not what’s worth repairing on request.

Configuration  #

format prints, --write writes, check answers with a patch and a status, lint reports, lint --fix fixes, and ci asks both questions without touching the tree. A job that edits the tree it’s judging is a job whose verdict means nothing.

The same findings come out as the compile-style line file:line:column: severity: [rule] sentence, JSON, SARIF, GitHub annotations, or null. --watch re-runs when a file the run read changes. SIFT_JOBS is the only setting that controls parallelism.

Settings are sift.yaml, or a sift.scm the project has trusted. They’re layered: defaults, system, user, project, command line. Discovery stops at the repository root. YAML is data and can’t execute anything; Scheme is code and must be trusted explicitly, with --config, SIFT_TRUST_CONFIG=1 or sift config trust sift.scm. An unknown key is refused with a position, and sift config show --verbose names the layer that won.

line-length: 90
brackets: square
severity: warning
checkers: [trailing-whitespace, docstring-missing]
stdlib: true
copy

The formatter has few knobs on purpose: a formatter with a hundred options has no opinion. The tuning lives in the linter, where you choose which of the 95 rules run, what their thresholds are, and which severity fails a build. The language server reads the same files, so sift.yaml is the single place where editor behaviour is written down: inlay hints, hover, completion, stdlib, downloads, compiler diagnostics, import organization.

The language server  #

sift lsp speaks LSP over standard input and output, so the editor and the pipeline get the same findings, fixes and formatting.

It answers diagnostics, quickfixes, fix-all, the extract and inline refactors, import organization, formatting, hover, definition, references, highlights, symbols, completion, inlay hints, rename and signature help; a file rename keeps a Scheme module or an Emacs Lisp provide in step.

It refuses the type hierarchies, semantic tokens, code lenses, folding, range formatting, format-on-type, pull diagnostics and workspace folder changes. sift models no types, expands no macro, and has no opinion about what to fold. “Method not found” is more useful than a plausible lie.

The project is read in a thread from initialize on. Two thousand files arrive in batches of sixty-four, so the first answer comes after the first batch and each later batch replaces the snapshot whole. A jump has 100 ms, a reference search 200 ms, and sift/indexStatus says how far the reading has got.

The standard library is indexed from source: Guile’s modules, Emacs’s load-path and package trees, ASDF and SBCL sources, Racket’s collects and pkgs, and what each implementation says about itself. car is compiled into libguile and no file says where, so the implementation is asked once to write down every name it documents, as source. A jump to car lands in code that reads like the file it’s in. Writing that felt a little illegal, and it’s the LSP work I’m proudest of.

The server can ask the dialect’s compiler for a second opinion on open or save: guild, emacs, sbcl, whichever is installed. A missing compiler is simply not asked, and compiler-diagnostics: false turns it off.

The editing loop  #

My Emacs configuration ( heks-emacs) puts a Geiser REPL in the middle of Scheme development. C-c g r starts or switches to the project’s REPL: a guix repl in a package buffer, a plain guile one elsewhere, one per project. C-c g e evaluates the definition at point, C-c g b loads the file, C-c g k interrupts, C-c g d opens the debugger.

sift runs in the same buffer, at the same time, without asking the REPL for anything. sift-flymake runs sift lint --stdin --format=json on the buffer’s own text, saved or not, and turns findings into Flymake diagnostics with the rule’s code and name. The drift backend marks the lines sift format would rewrite. C-c g H explains the rule at point, C-c g a applies its fix, C-c g A applies every fix, C-c g f formats. Nothing is written; every step is one undo away.

The REPL and the linter answer different questions. The REPL knows what the program does when it runs: the loaded state, the values, the stack, the debugger. sift knows what the file says and what a pipeline will say about it, which is how it can tell you that a cond clause after else can never run, that an import is unused, or that a line isn’t formatted the way sift ci will require. A REPL can’t tell you your file is unformatted, and a formatter can’t tell you what an expression returned. So sift is asked first, because it needs nothing but itself; guild compile and guix lint are the second opinion on save; Geiser is the third, for what only a running image knows.

The loop I do a hundred times a day: start the REPL, write a one-armed if, watch SIFT012 appear on a dirty buffer, read the rule, apply the fix, evaluate the definition, format, reload. No save and no build in the middle.

Editors, CI and the browser  #

The clients are thin wrappers over the program:

Editor What to use
Emacs emacs/sift.el: Flymake and Eglot
Neovim editors/vim/neovim.lua: a vim.lsp.start setup
Vim editors/vim/: :SiftLint, :SiftFormat, :SiftFix, :SiftExplain
VS Code editors/vscode/: no build step, no dependencies
Helix format on save through sift format --stdin
the browser web/: sift compiled to WebAssembly

In a pipeline, one command asks both questions:

sift ci src/ tests/
copy

It exits 1 if either check finds something, 2 if a file can’t be read or parsed, and it never writes. There’s a reusable GitHub workflow:

name: sift
on: [push, pull_request]
jobs:
  sift:
    uses: jjba23/sift/.github/workflows/sift.yml@v1.41.2
copy

It annotates the diff and uploads SARIF to code scanning, so an unfixed finding becomes an alert instead of a line in a log. There’s also a composite action, a pre-commit hook, a pre-commit declaration, a dprint process plugin, and a Docker image.

The browser build sounds like a stunt and isn’t. web/ is formatting and linting compiled to WebAssembly with Guile Hoot, with an editor page around it. The same reader, formatter and 95 rules are in the tab; the two rules that need a project report nothing, and no input leaves the tab. The whole contract is one procedure of one string to one string:

(web-request  "{\"op\":\"lint\",\"source\":\"(if a b)\"}")
 ;;  => "{\"ok\":true,\"result\":{\"warnings\":[…],\"counts\":{…}}}"
copy

The module is 3.4 MB. A screenful formats in 17 ms and lints in 56 ms; 1.2 kB is 52 ms and 145 ms; 6 kB is 780 ms and 1.2 s. The first two rows never reach the 300 ms debounce. The number isn’t the interesting part. The source of truth stayed put: the tab runs the same modules bin/sift runs, four Guile libraries have stand-ins in web/compat, SRFI-13 is thirteen procedures with a test that compares the browser’s answers to Guile’s byte for byte, and eight tests hold the dependency one way.

The page is live at https://jointhefreeworld.org/sift/: an editor with the dialect, style and severity as controls, findings linked to the source, an outline, completion, inlay hints and a rules browser.

The sift editor in a browser tab
The browser build at jointhefreeworld.org/sift. The same reader, formatter and rules, compiled with Guile Hoot.

What a run costs  #

On my machine:

lint the tree (28 files, 14896 lines)       337ms, 160.7 MiB allocated
check the tree (28 files): format           253ms,  59.0 MiB allocated
lint (lsp.scm, every checker)               171ms,  19.2 MiB allocated
read the tree (28 files)                    143ms,  44.7 MiB allocated

Both numbers matter: a pass that conses per node makes every other pass slower, and the allocation count shows it even when the clock looks good. Three questions dominated the cost of a lint, each originally answered by walking something a second time: whether a node is code or data, what a form is called, and where the lines begin. Computing each once took a lint of the repository from twenty-five seconds to under one, and the allocation from a gigabyte and a half to a hundred and forty megabytes.

The suite I ran while writing this: 119 suites, 1160 tests, 2624 assertions, about a minute. The reader is tested dialect by dialect, the formatter on a golden corpus plus an idempotence pass, each rule with a passing case, a failing case and a re-lint after its fix, the CLI as a subprocess, the language server over the wire. The project formats itself, so maak self-check is a real gate.

The style  #

The style is the common practice of the four communities, written down in doc/style.org: Riastradh, Google’s Common Lisp guide, the Emacs Lisp manual’s docstring tips, R7RS, and the conventions of Guile and Guix.

The short version: two columns for every body; arguments align under the first; one blank line between top-level forms, never inserted where there was none; closing delimiters trail unless a project says dangling; square brackets for Scheme clauses as a setting, not a law; keywords line up; your macros get your indent rules, because no formatter knows what your macro means; no reflowing, since a line break records where you judged the form to end; a reader prefix glues to its datum; a comment stays on its line.

sift declines some Riastradh rules: a 72 or 80 column limit (the default is 96, or 80 for Emacs Lisp), pages and form feeds (they rewrite every line number below the break), 21-line top-level forms, and with- versus call-with- prefixes, which needs to know whether an argument is called.

What it won’t do is the other half of the style. It doesn’t rename, reorder or inline a procedure on its own, and it doesn’t introduce a delimiter. It never guesses a dialect. A fix it can’t verify is discarded, not applied with a warning. Lint reports, fix is opt-in, and CI never writes. Suppression belongs next to the code, and codes never move, because a code is what an editor and a bug report quote. Few knobs: a formatter with a hundred options has no opinion. Refuse what you can’t answer. The browser is a compile of the same modules and the editors are thin wrappers, so there’s no second implementation. MIT, because a formatter in other people’s pipelines can’t carry a licensing question.

It doesn’t expand macros, type-check or know your conventions. It reports and you decide. Where it can be wrong, the rule says so: wrap-in-let is a suggestion, keyword-arguments counts, thresholds are settings. The LSP has two limits: references are matched by name within one dialect, and the project is read in the background, so a jump answers from what’s been read. Range formatting, format-on-type, fold ranges, macro-introduced names, pull diagnostics and a --since REV mode are in scope and not built yet.

Compared to the neighbours  #

Clojure is the one Lisp community that has this. cljfmt formats and clj-kondo lints, both good, and both Clojure-only. Outside it, Scheme has scheme-mode, guild compile -W3 and guix style, and none of them is a general formatter, a project linter or an LSP. Emacs Lisp has checkdoc and the byte-compiler, but a compiler warning is prose: no stable code, JSON, SARIF, CLI or fix. Common Lisp has SLIME and SLY, which are an environment, not a program a pipeline runs. Racket has its own tools, and a repo with Scheme and Elisp still needs the others.

The canonical formatters are the other reference point. rustfmt and gofmt are one language, one style and no linting; their authority comes from being canonical, while sift has to write the style down. clang-format makes configuration its product, which is the opposite bet. Prettier is the closest in philosophy, but it reflows and doesn’t preserve every comment and blank line.

The neighbours do three things I want to steal: a checkable macro configuration from clj-kondo, answers from real analysis from SLIME and SLY, and the authority of a canonical tool from rustfmt and gofmt.

Inside Guix and Guile the gap is habits: assoc-ref %outputs, a #$output that makes a file, a use-modules inside a gexp that with-imported-modules doesn’t mark, an unquoted phase name, a sha256 that isn’t (base32 "..."), a synopsis that opens with an article, inputs written as a labelled alist. Those are rules with codes and fixes now.

Under the hood  #

src/sift/ is one module per job:

records.scm       locations, findings, rule records, codes, AST nodes
reader.scm        the permissive, location-preserving reader
format.scm        the pipeline, indentation tables, renderer
checkers/         one module per family of rules
lint.scm          run, suppress, filter, sort, fix, re-lint
render.scm        human, JSON, GitHub, null, SARIF
config.scm        discovery, merging, provenance, trust
lsp.scm           diagnostics, actions, formatting, hover, navigation
cli.scm           args-fold, dispatch, exit codes

records is the vocabulary; reader and format use it; the checkers use records and check/base; lint assembles them; render prints; lsp speaks the protocol; cli wires it up. Nothing in format or a checker knows about ports or exit codes.

The implementation is Guile 3.0 and the standard library. No C dependency, no build step. The launcher is a small POSIX shell script that finds its own symlink chain, puts src/ on the load path and hands the arguments to (sift cli).

Install with guix install sift from the guix-jointhefreeworld channel, nix run from the Nix flake, Homebrew from the tap, a container image, or a checkout and ./bin/sift version. The Emacs package is one file with no dependencies beyond Emacs 28.1.

Come help  #

The list of Lisp dialects that deserve a better reader is long.

  • A bug report. Give the input, the output you expected, and sift version with the first section of sift doctor. A file sift refuses to parse is a bug even when the file is broken; the message must say where.
  • A rule. One record and one test file. The catalogue, docs and editor integrations follow.
  • A dialect detail. An escape, a comment in an odd place, a body that indents by something other than two.
  • An editor integration. Neovim, Vim and VS Code each have a directory and a test; a fourth editor is one directory more.
  • A sentence in the docs. A sentence that causes hesitation is a defect.

To start: read doc/style.org, run maak test, add the rule or fix with its test under tests/checkers/, then run maak self-check, maak check and maak fixture-check. Send a pull request, or a patch with git format-patch and git send-email.

The AI policy is short: agents may explore, plan, branch, run the build and tests, commit, push, open and merge pull requests, and cut releases. A human is the author of record and must be able to explain and debug every line. TDD is required, and the tool and what it did are disclosed. A rule written with an agent is as welcome as one without; the review concerns the code.

What’s next  #

  • Range formatting and format-on-type. The formatter indents from column zero, so a fragment lands at the margin. The hard part is an origin column that still produces, for the range it touched, the bytes a whole-buffer run would.
  • A --since REV mode. Lint the lines a diff touched, not the whole tree, so a large codebase can adopt a linter without a mass reformat.
  • Resolution across files. Follow define-module, #:use-module, defpackage and provide far enough that a reference is a binding, not a name. Then a project-wide rename is correct in every file.
  • A declared-macro table. A project declares what its macros bind, so references and rename can see the names a macro introduces.
  • The style as a specification. The rules and the corpus are already there; the next step is a document a second implementation can be checked against.
  • A fifth dialect. Racket was the fourth and cost a table, a dozen rules re-argued and a corpus of its own. Each one after that is more evidence that the reader, formatter and rule records are the general part.

None of this is a promise with a date. If one of them sounds like your afternoon, open an issue and I’ll help you land it.

Closing  #

The failed attempts taught me that a Lisp file is a tree, that a community can agree on a style and a program can enforce it, and that the language’s own reader and compiler know more than any regex. The detours taught me the rest: never reflow, let one representation win, put the conventions in a program, ship one executable.

What none of them had was the premise: read the file as a datum with positions and print it back. Once that was true, formatting became a fixed point, a fix became a range, a finding became data, and the editor and the pipeline got the same answer. The seeds weren’t wasted either. They were the reader, the style and the rules, waiting for the thing that would hold them together. The name is the bet: a source file mixes the program with the layout; sift separates them, checks the program, and puts the layout back.

If you have a Lisp dialect that deserves a better reader, a rule your project keeps repeating in review, or an editor that should have the server, come and plant one.

Thursday, December 3, 2026

Monday, November 30, 2026

Scheme Requests for Implementation

SRFI 282: Additional R7RS (Type) Predicates

SRFI 282 is now in final status.

Types and entities deserve predicates so that their user can meaningfully understand what they are dealing with, and usefully dispatch on them in their code. However, some R7RS “types” have no respective predicates. This SRFI defines them.

by Artyom Bologov at Monday, November 30, 2026

Saturday, November 28, 2026

crumbles.blog

Note about my fediverse account

Update, 29 November: The suspension has now been reversed and I received an apology from the mastodon.social moderation team. They acknowledged having made a mistake, and say there is a discussion internally on how to prevent the mistake recurring.


My fediverse account, @dpk@swhack.com, has been suspended on the largest Mastodon instance, mastodon.social, for unclear reasons since roughly Tuesday 24 November.

This apparently means that if you have your account on mastodon.social and I was following you, I can no longer see your posts, but if you were following me, you may still be following me but I doubt you will see any of my posts there.

At the beginning of September I moved from chaos.social to my own Mastodon instance, meaning I should be able to see moderation reports made against my own account. I did not receive any report about my account before the suspension was made, and I only noticed because posts from people I also follow via Bridgy on Bluesky only showed up on the Bluesky side and not in my own fediverse timeline.

Attempts to reach the moderation team of mastodon.social have thus far not yielded a reply. I’m going to continue to follow this up and hopefully get it resolved soon.

Saturday, November 28, 2026

Friday, November 27, 2026

Joe Marshall

Updates to named-let

Updating named-let: ignored bindings, multi-form inits, and more

named-let is a small Common Lisp library of Scheme-inspired binding macros: named-let, named-lambda, letrec, letrec*, flambda, and a Lisp-1 style define. It also provides an extended let that you can shadow-import in place of the standard one. This post describes a round of changes to the library: a new way to ignore bindings, clarified handling of multi-form bindings, a bug fix, and improvements to documentation and tests.

Ignored bindings with _

Sometimes you want to bind something only for its side effect. In standard Common Lisp you must invent a variable and declare it ignored:

(let ((a 22)
      (dummy1 (format t "foo"))
      (b (sqrt 2))
      (dummy2 (format t "bar")))
  (declare (ignore dummy1 dummy2))
  body)

Now the extended let does this for you. Any binding of the symbol _ is replaced by a fresh uninterned symbol (a gensym), and a single ignore declaration for all such symbols is added at the start of the body:

(let ((a 22)
      (_ (format t "foo"))
      (b (sqrt 2))
      (_ (format t "bar")))
  body)

;; expands to

(let ((a 22)
      (#:ignore-1 (format t "foo"))
      (b (sqrt 2))
      (#:ignore-2 (format t "bar")))
  (declare (ignore #:ignore-1 #:ignore-2))
  body)

A few details worth knowing:

  • The init forms are still evaluated, and in order, so _ is useful for side effects.
  • You can have any number of _ bindings; each gets its own gensym, so there is no “variable occurs more than once” error.
  • The bare forms _ and (_) are accepted and bind to nil.
  • _ is matched by name, not by identity, so it works no matter which package your code is read in.
  • A declare at the start of your own body coexists with the generated one.
  • Because the generated declaration is placed first, the ignored variable can never be referenced from the body; _ is not a variable you can read.

The same convention applies to a named let, because its bindings become the parameters of a named-lambda, and to named-lambda parameters themselves:

(funcall (named-lambda second-arg (_ x _) x) 1 3 2)
;; => 3

(funcall (named-lambda f (a &optional (_ 9)) (+ a 3)) 1)
;; => 4

Multiple forms in a binding

A binding in the extended let may contain more than one init form. The forms are wrapped in a progn and the last value is bound:

(let ((a (format t "binding a") (+ 2 (sqrt x))))
  (+ a b))

;; expands to

(let ((a (progn (format t "binding a") (+ 2 (sqrt x)))))
  (+ a b))

The library already handled this, so no code change was needed, but it is now pinned down with a test and documented. As in standard Lisp, a bare variable y or a one-element binding (z) is bound to nil, and all bindings are made in parallel: init forms do not see the new variables.

How the expansion works

The extended let looks at its first argument. If it is a list (or nil), it is an ordinary binding list; the macro walks the bindings, replaces each _ with a gensym while collecting the gensyms, and emits the underlying let with the bindings, an optional (declare (ignore ...)), and the body. If the first argument is a symbol, it is the name of a named let and the expansion is a funcall of a named-lambda.

As before, the macros are SERIES-aware. Expansions refer to let and funcall in the SERIES package when it is loaded and the symbol is fbound there, and to COMMON-LISP otherwise. That is why an expansion you inspect in an image with SERIES loaded will begin with series::let. Expansion templates use qualified symbols so they resolve to COMMON-LISP symbols regardless of any shadowing in the consumer's package.

A bug fix in named-lambda

Writing more tests for _ turned up two bugs in named-lambda, which also supports _ parameters:

  1. The binding that extracts an optional docstring had a misplaced parenthesis, which made the let* binding spec malformed and caused a compile error in the macro definition.
  2. It recognised _ by comparing with eq against the symbol named-let::_. A _ read in any other package is a different symbol and so was not recognised, leading to a “variable _ occurs more than once in the lambda list” error. It now compares symbol names, exactly as let does.

Docstrings and comments

Every macro in the library now has a docstring. named-lambda and named-let were missing them, and letrec* had copied letrec's text; it now says its bindings are initialised sequentially so later ones can use earlier ones. I also added short comments in the places where the code is not self-explanatory: the gensym-and-declare logic in let, the difference between letrec (simultaneous assignment) and letrec* (sequential assignment), and the _ handling in named-lambda.

Tests

The FiveAM suite grew from 24 to 44 checks. The new tests cover:

  • _ in let: evaluation order of the init forms, the shape of the expansion (distinct uninterned symbols and a single declare), bare _ and (_), all-_ binding lists, and a user declare alongside the generated one.
  • Multi-form bindings, both the expansion and the resulting value and side effects.
  • Parallel binding semantics and a let with only a declare in its body.
  • named-lambda with repeated _ parameters, _ with a default in &optional, and a docstring.

Run them with (asdf:test-system "named-let-test"). One practical note when writing your own: do not use names locked by the implementation (such as loop or count) as the name of a named let.

Documentation

The README was rewritten with a summary table and examples for every macro, including the previously undocumented flambda. Along the way I corrected a few inaccuracies: the clone URL, and the claim that define defines local functions (it is a top-level form that stores the function in the symbol's value cell and defines a macro that funcalls it).

There is also a short section on choosing a name for a named let. When the name just means “go around again”, a short one such as next or l reads well:

(named-let next ((i 0) (acc '()))
  (if (= i 5)
      (nreverse acc)
      (next (1+ i) (cons (* i i) acc))))
;; => (0 1 4 9 16)

You cannot call it loop: COMMON-LISP already binds that symbol as a macro, and implementations such as SBCL lock the package. The same is true of other standard names like count.

Getting it

The code is on GitHub at jrm-code-project/named-let. Clone it into your Quicklisp local-projects directory and load it with (ql:quickload "named-let").

by Joe Marshall at Friday, November 27, 2026

Saturday, November 21, 2026

Idiomdrottning

MPD as shell event driver

Here is a shell script for having the Music Player Daemon trigger events. It shells out to mpc and this example config also shells out to kasa, a lamp control app. In the example, each album in the playlist has its own mood lightning. You can get fancy and add --transition flags, perhaps starting the transition by %position% of the previous album’s last song and prepending a sleep such-and-such-many seconds; rather than by %album%.The script is meant to run in the background or with dtach or systemd until mpc’s event listener hears from MPD.In the past I’ve used MPD as a soundboard backend when DM-ing and if it can also control lights (more subtly than in this example) I might want to dust that off.#!/bin/sh # Put any pre-loop commands here such as exports and any initial # settings you want before the sound starts playing export KASA_USERNAME="your kasa email" export KASA_PASSWORD="your kasa password" export KASA_HOST="your kasa IP" while true; do pos=$(mpc -f %position% current) album=$(mpc -f %album% current) case "$pos" in 2) kasa brightness 100 ;; esac case "$album" in "Veil of Imagination") kasa hsv 120 100 80 ;; "The Fierce and the Longing") kasa command set_device_info '{"color_temp": 4500, "brightness": 20}' ;; "When I Die, Will I Get Better?") kasa hsv 200 40 85 ;; "Still Life (Remastered)") kasa hsv 0 100 50 ;; esac mpc idle player done For a repo of this example script,git clone https://idiomdrottning.org/kasampd

by Idiomdrottning at Saturday, November 21, 2026

Thursday, November 19, 2026

spritely.institute

Lisp Game Jam devlog: Polydraw

This year's Autumn Lisp Game Jam has just wrapped up! Spritely's contribution to the jam was Polydraw, a peer-to-peer party game that is easy to pick up and play with friends. In Polydraw, players take turns being the artist who draws an image based on a prompt. The catch is that the artist only has 60 seconds and can only draw using triangles. All of the other players are guessers who try to correctly guess the prompt. We're quite pleased with how the game turned out!

The rest of this post is a daily devlog of how we made Polydraw so you can see what the process look likes to make a game with Goblins and Hoot under a tight deadline.

Day 1 (10/30)

It's go time! First, we created a Git repository on Codeberg and copied the Hoot game jam template into it.

Since the core activity in Polydraw is drawing triangles, the first thing Dave implemented was an interface for doing that on a canvas. This first version was crude and didn't include a color picker.

Day 2 and 3 (10/31 and 11/1)

We took the weekend off to prepare for a busy week ahead.

Day 4 (11/02)

This is the day that we really got to work on the game jam.

The first version of the triangle editor stored pixel coordinates of the local canvas, but that wasn't going to be good enough to display on other machines with different sized canvases. So, Dave simply normalized triangle vertices into the [0,1] range so each peer could scale them as needed.

Dave also implemented a basic scene system, a common game programming pattern, to encapsulate the coarse game states such as the title screen, the lobby, and the main game.

A color palette was added along with some additional mockup UI around the canvas.

Day 5 (11/03)

With a good enough game engine in place, we turned our attention to the game protocol. Since we are using Goblins, all interactions are modeled using actors. Dave came up with the following actors:

  • Player: Used for player identity within the game and contains the player's self-proposed name.

  • Lobby: The place where players gather before the game starts. The player that creates the lobby is the host and all other players are guests.

  • Game: Holds all of the game state like the player list, whose turn it is, and the scoreboard.

  • Controller: A player's virtual game controller. Used to speak to the game actor, but all actions are scoped to the individual player.

A test script was written to simulate creating a game, joining the lobby, and playing a round. At this stage, everything was happening in a single process. Goblins makes it easy to start with a single process and then distribute the actors to multiple machines later.

Day 6 (11/04)

Now it was time to get the actors onto the network and hook them up to the game UI. For networking we used OCapN, naturally. Jessica started up an instance of our new end-to-end encrypted relay netlayer that we set as the default relay so the game would "just work" when we uploaded it to itch.io. In fact, dogfooding the relay was a large part of the motivation behind participating in the game jam in the first place!

Dave got the actors online with OCapN and connected the game UI to the actors, then confirmed that a three player game works. Three players is the minimum number of players needed to trigger OCapN's third-party handoff feature. Handoffs are what enable distributed networking in OCapN: Alice can give Bob a reference to Carol, which causes Bob and Carol to establish a new OCapN session with each other. This is the first application we've made that does handoffs over the relay netlayer and it was nice to see them working as intended.

Unfortunately, we discovered an issue with how Goblins handles two peers connecting to each other concurrently, a problem known as "crossed hellos". OCapN mandates that only one connection may be open between any two peers, so we have to pick which connection wins. The bug is that any promises that were created over the losing connection never resolve. This was observed in the game as an empty lobby player list that should be populated. It didn't prevent the rest of the game from working, though, so we didn't try to fix it (yet).

Day 7 (11/05)

On this day, Dave discovered that, despite his best efforts, he fell victim to the "identity footgun". We could write a whole blog post series about the many subtle issues of object identity (in the sense of Scheme's eq?) in object capability systems, but instead we'll refer you to the The Grant Matcher Puzzle and just mention that using object references as keys in associative data structures is error-prone. A promise that eventually resolves to a reference to Alice is not identical (again, in the eq? sense) to a reference to Alice. So, if you accidentally use a promise as a key somewhere or use eq? directly you will probably have a bad time, which is exactly what happened to us.

To deal with this identity crisis, Dave first detected it at runtime by writing a wrapper around eq? called geq?. This new predicate throws an error when comparing a promise to a non-promise. Then he used the resulting backtraces to find the offending code and change it to resolve all necessary promises before doing identity comparisons.

Christine finally cleared enough other things off her plate where she could start contributing to the game. We thought it would be nice to have the game start with a splash screen of triangle'y animations that would resemble the kinds of art players would make in the game. We decided to use the Blender add-on by Ursula Kurdali named Stop Motion since it gives a great amount of freedom to animate by creating and destroying as much geometry as you like. Christine made the first mockup of a splash screen animation of a "death" type character swinging a scythe.

However, the animation hadn't left Blender yet. We're gonna have to figure out how to get those polygons out and into the game engine!

Day 8 (11/06)

This was the day to finish implementing the core game loop. We wanted the weekend to be all about fixing bugs and making it look and feel as good as we can. At last, the points awarded at the end of each round were displayed in the UI. The player list on the left side of the screen was transformed into a leaderboard that sorted players by score.

While creating the leaderboard it was discovered that Goblins was not correctly parsing pairs received over OCapN. Christine swooped in with a quick fix and Jessica folowed up with a regression test.

We also added a small set of emoji reactions underneath the leaderboard. Reactions were not critical to the core gameplay but they were planned from the very beginning of the project. It's good that we had time to add them because it was a lot of fun to spam emojis at the artist to give them an indication of how good or bad they were doing.

Day 9 (11/07)

With two days left and the core gameplay loop complete, the focus shifted to bug fixing and adding juice. Up until this point the HTML was mostly unstyled (as you can see in the videos above), so Dave added a little CSS to improve the look and feel.

A playtest revealed that the simple PRNG we were using was implemented incorrectly. We noticed because the artist prompt was always "bus" no matter how many rounds you played. Oops! This was fixed.

Remember that crossed hellos bug from day 7? Dave finally implemented a workaround, which was to simply throw out the first pancake and try again, as suggested by Christine. A simple race against a timeout was all that was needed. We'll be thinking about how to fix this in Goblins so this situation cannot happen in the future.

Christine started work on making more animations for the game's intro. The "death" animation was a good "hello world" for testing the exporter, but being all black it was too simple to make sure everything worked right; draw order, etc, didn't matter. Christine made a "square guys" animation as a kind of Acid2 test equivalent. This file had several tricky properties to it, most especially that draw order would matter, colors would be important, et cetera.

Christine also made this triangle'y duck themed piece:

Christine wrote a Python script to export the animations from Blender into a custom format encoded using Syrup. The encoded data was then embedded into the Scheme program as bytevector literals using a little script. Dave then started work on a renderer for these animations, but it wasn't working quite well enough by the end of the day to commit and push it.

Up until this point we only had a small number of frequently-repeated words. Morgan Lemmer-Webber curated a word list for us, starting with an existing public domain word list of 5000 words, and curated down to a 621 words, selecting for words that were more feasible to draw (ranging from easy to challenging, but all trying to be feasible).

The game name was changed from the placeholder "Twenty Triangles" to "Polydraw".

Day 10 (11/08)

The final day.

The code to render animations was finished. Some final minor bug fixes were made. Some CSS was tweaked. Original music and sound effects by encrypted.whispers were added. Additionally, we used a few CC0-licensed sound effects by Kenney.

A few gameplay improvements were made, such as showing guessers what the prompt was when the round ends and how many triangles the artist had remaining. Little improvements can make a big difference and both of these changes were very helpful for players and made the game feel more polished.

There wasn't enough time remaining to do as much work on resiliency in the face of network partitions as we would have liked, but Dave did squeeze in a commit that allowed the game to survive if a guest leaves. Unfortunately, the experience for the disconnected guest isn't very good as they don't see any message that their connection dropped.

We did a final playtest to confirm that there weren't any showstopper bugs. Christine added final splash animations.

Finally, Christine added some code (fixed up by Dave) and animations which would overlay over the drawings indicating that drawing was starting, it was time to guess, or the results.

Pencils down!

We submitted the game two hours before the deadline! Now it was time to catch our breath and show off the game to everyone we could. Dave even played it live with a couple other people on a stream! Here's a screenshot which gives you a good look of the final result:

The response was quite positive! The feedback we received closely matched the things we wanted to improve upon if we had more time: better disconnect handling, a way for the host to skip to the next phase instead of being forced to wait for the timer to run out, and invite URLs (rather than URIs) that auto-join the game when visited.

Polydraw ranked 5th overall in the official game jam results.

Try playing it over on itch.io and leave us a comment!

Thanks to our supporters

Your support makes our work possible! If you like what we do, please consider becoming a Spritely supporter today!

Diamond tier

  • Aeva Palecek
  • David Anderson
  • Holmes Wilson
  • Jonathan Frederickson
  • Lassi Kiuru

Gold tier

  • Alex Sassmannshausen
  • Juan Lizarraga Cubillos
  • Nerine Pekowsky
  • Serra Allgood

Silver tier

  • Austin Robinson
  • Brit Butler
  • Charlie McMackin
  • Dan Connolly
  • Deb Nicholson
  • Diana Thayer
  • Eric Bavier
  • Eric Schultz
  • Evangelo Stavro Prodromou
  • Evgeni Ku
  • Glenn Thompson
  • James Luke
  • Jonathan Smith
  • Jonathan Wright
  • Justin Sheehy
  • Matt Panhans
  • Michel Lind
  • Mike Ledoux
  • Nathan TeBlunthuis
  • Nia Bickford
  • Noah Beasley
  • Steve Sprang
  • Travis Smith

Bronze tier

  • Alan Zimmerman
  • Aria Stewart
  • Ben Hamill
  • Benjamin Grimm-Lebsanft
  • Brooke Vibber
  • Brooklyn Zelenka
  • Carl A
  • Crazypedia No
  • Ellie High
  • Elliot Martin
  • François Joulaud
  • Gabor Udvari
  • Grant Gould
  • Gregory Buhtz
  • Ivan Sagalaev
  • James Smith
  • Jason Wodicka
  • Jeff Forcier
  • Marty McGuire
  • Mason DeVries
  • Michael Orbinpost
  • Neil Brudnak
  • Nelson Pavlosky
  • Nicholas Farley
  • Philipp Nassua
  • Rodion Goritskov
  • Ron Welch
  • Stefan Magdalinski
  • Stephen Herrick
  • Steven De Herdt
  • Tamara Schmitz
  • Thomas Talbot
  • William Murphy
  • Yoshua Wakeham
  • a b
  • chee rabbits
  • r g
  • terra tauri

by Dave Thompson, Christine Lemmer-Webber at Thursday, November 19, 2026

Saturday, November 14, 2026

Scheme Requests for Implementation

SRFI 289: Unordered sets and bags

SRFI 289 is now in draft status.

Sets and bags (also known as multisets) are unordered collections that contain only objects of a type given by a collection’s SRFI 128 comparator. Every element of a set is unique (in the sense of the set’s comparator), but bags can contain any number of duplicate elements. This SRFI is a revision of SRFI 113 that fixes several infelicities and is more consistent with related SRFIs.

by Wolfgang Corcoran-Mathe (text and test suite), Peter McGoron (sample implementation), and John Cowan (author of SRFI 113) at Saturday, November 14, 2026

Sunday, November 1, 2026

Scheme Requests for Implementation

SRFI 272: Pretty Printing

SRFI 272 is now in final status.

This SRFI follows the traditional Scheme model of pretty printing, which treats it as a process distinct from general controlled formatting. While general-purpose formatters often prioritize specialized presentation at the expense of machine-readability, Scheme’s pretty-printers (such as those of SLIB and MIT Scheme) have traditionally treated pretty printing as a variant of write, differing primarily in the insertion of whitespace to make the presentation more palatable to humans. Common Lisp’s pretty-printer, by contrast, fills two roles simultaneously by integrating pretty printing with both its format facility and its generalized write procedures. This unified approach offers great power, but at the cost of complexity that can make it difficult to use effectively. We propose a specialized, layered approach, specifying five libraries of increasing functionality, where all but the first are optional. The libraries are downward-compatible: more powerful libraries satisfy all requirements of the simpler ones while adding new features. Implementors may choose to support a maximum level of functionality appropriate for their systems. Integration with monadic and string-based formatting libraries is supported.

by Sergei Egorov at Sunday, November 1, 2026

Thursday, October 29, 2026

Scheme Requests for Implementation

SRFI 279: In(tro)spection Protocol

SRFI 279 is now in final status.

Interactive REPL-driven systems (that most Schemes are) need a way to get detailed information on a given piece of data. Inspectors, as these are conventionally called. This SRFI defines a basic protocol for inspectors, consisting of three procedures: inspect-properties, inspect-property, and inspect-describe. Some suggestions for standard and popular types’ inspection are also provided.

by Artyom Bologov at Thursday, October 29, 2026