Why compile Magic: The Gathering?
·1 min
Placeholder. This page exists to validate the site setup (layout, code highlighting, the series hub). Replace the body with the real write-up.
Magic: The Gathering has tens of thousands of unique cards, each carrying rules text written in a semi-formal natural language (“Oracle text”). A first taste of the data we are working with:
card = {
"name": "Lightning Bolt",
"oracle_text": "Lightning Bolt deals 3 damage to any target.",
}
To generate new cards with a language model and have them actually parse and resolve, free-form text isn’t enough — you need a grammar and a typed representation to constrain the output. That is what mtg-compiler builds: a typed AST, a symbolic DSL, and a cost model. Why each piece is needed is the subject of this series.