Skip to content

· 4 min read

Jai puts the build in the program

Jonathan Blow's language lets ordinary program code participate in compilation. The interesting part is what a project can ask its own compiler.

A mechanical arm fits a gear into an open brass workshop, with spare cogs and a caliper in front.
Illustration generated with GPT Image

Add a field to a game object. Now update the save format, the editor inspector, and the debug display. Somewhere there is probably a script that generates one of those. Somewhere else there is a build rule that remembers when to run the script. The field was the easy part.

This is the sort of problem that makes Jonathan Blow's Jai interesting to me. In his Jai demo and design keynote, the project's build logic is a program written in Jai. It can create a compilation workspace and receive information from the compiler about the program being compiled. Your application and the machinery that builds it get to use the same language.

Start with the game#

Jai grew out of Blow's work on games. His 2014 introductory talk was explicitly about a language for game programmers, and the early prototype demo already included compile-time execution. These are historical demonstrations, rather than a specification of today's syntax, but the direction is recognizable.

A game gives a language designer quite specific complaints. Data must reach rendering, collision, persistence, and tools. The programmer keeps making small changes and running the result. An abstraction that looks tidy in isolation can become a nuisance when every subsystem needs to know what it means.

Jai's response gives the programmer considerable control. Blow describes it as a systems language with manual memory management. The compiler can help you inspect and check your program; that does not establish a general memory-safety guarantee. The design depends on the programmer choosing useful rules for the software they are making.

The compiler can answer project questions#

The keynote's build program receives compiler messages in user code. Blow shows workspaces as separate compilation contexts and emphasizes that this metaprogram uses the same language as the game. Shared functions and data can serve both. That is a more substantial idea than folding an arithmetic expression before the executable starts.

Consider a rule for a save system: a persistent record must not silently gain a field the serializer ignores. With access to type information, project code could compare the record's fields against its serialization policy and report a mismatch. This is an example of what I would build on the mechanism, not a claim that Jai ships that policy.

  1. Inspect a type

    Read the fields the compiler has resolved.

  2. Apply a rule

    Check each field against the save policy.

  3. Report the omission

    Point the author at the unsupported field.

A proposed project check using compiler information; the save policy belongs to the application.

The useful part is the location of the knowledge. The compiler knows what a field is. The game knows what saving means. A project-specific check can bring those facts together without asking the language designer to add a serialization feature for every game.

Ordinary code brings ordinary maintenance#

In his November 2025 conversation with Richard Feldman, Blow returns to metaprogramming and compile-time execution as central design choices. The attraction is easy to understand: helpers, data structures, and debugging skills can carry over into the build.

I would still keep that program small. A generator can hide a surprising amount of work behind one declaration. A check that walks the entire project after every little edit can become its own source of delay. Giving build logic a familiar language makes that logic easier to work on; it also makes it easier to write more of it.

My first experiment would be one narrowly useful check, with a clear diagnostic and a measured cost. Then I would change the relevant type and make sure the check catches the mistake. That is enough to find out whether compiler access removes a maintenance problem. An elaborate reflection framework can wait.

A language needs this kind of pressure#

The most persuasive thing in the keynote is that the build program belongs to an actual game. It has a job beyond demonstrating the language. That gives the design somewhere to encounter the awkward cases: generated declarations, platform differences, tools, and the need to get back into the game after an edit.

This is why I would start learning about Jai through its build machinery. A language can save a few characters in a function declaration and leave the rest of development just as cumbersome. Here, the compiler itself is available as something the project can program against. I want to see how much duplicated knowledge that can remove.

It also makes compile speed a particularly interesting constraint. Every useful check takes time. The companion essay on a million lines per second looks at how much work can fit inside that ambition.