Research

Articles describing the card language and the engine. Each file has a stable, dated address: links to it will keep working, and a revised version gets a new date.

Grimoire: Located Handlers on Lazy Objects

A Minimal Core for the Rules of Magic: The Gathering, and a Fast Engine Tested for Conformance to It. Frantic Research, draft of December 2026.
2026-12-grimoire-g0.pdf

Magic: The Gathering is an extreme case of an extensible rule system: each card is a small program that may override the rules. We present Grimoire, a card language for the 540-card Vintage Cube, through its core calculus G₀ of eight effect operations. The state is a set of entities with typed attributes, and every rule-bending mechanism is a handler located on an entity that intercepts a read (a continuous effect, in layers) or a write (a replacement, a prohibition, or, as an observer, a trigger). Reading is lazy, so dependencies between continuous effects are discovered, and last-known information is a frozen value. G₀ is a reference semantics; the executable language is checked against it by differential testing, with more than eight million comparisons, and the resulting engine performs a state transition in 0.25 to 1.6 microseconds.

Located Handlers on Lazy Objects

A minimal effect core for a large card game, and a fast engine tested for conformance to it. Talk proposal. Frantic Research, December 2026.
2026-12-grimoire-hope.pdf

A short version for a programming-languages audience, no knowledge of the game required. It reports on G₀, the core of the card language of an engine for a pool of 540 cards: eight effect operations over which a vocabulary of about 300 names is defined. Handlers located on entities intercept reads (continuous effects) and writes (replacements, prohibitions), and observers after writes are triggered abilities. Lazy, memoised reads turn the game's dependency rule into something observed rather than declared. The executable language unfolds definitions and keeps native intrinsics, and its conformance to G₀ is checked by differential testing. The proposal ends with open questions for discussion.

Related: Grimoire for everyone, a non-technical introduction to the same ideas.