Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Ironsmith – A full grammar, parser, and compiler for Magic: The Gathering cards

Ironsmith is a full grammar, parser, and compiler designed to interpret Magic: The Gathering card text. It enables programmatic parsing and processing of the game's complex card rules.

Background

- Magic: The Gathering (MTG) is a popular collectible card game by Wizards of the Coast (Hasbro). Cards have complex, highly templated rules text, and an official Comprehensive Rules document governs gameplay interactions. - Ironsmith is a new open-source compiler that takes arbitrary MTG card text and converts it into a formal, executable rules model. It parses card language, builds a structured grammar, and can run the resulting logic — effectively turning English card text into a program. - Previous efforts (e.g., Magic Arena, XMage, Forge) implement game rules as hand-coded logic; Ironsmith instead tries to derive that logic automatically from the card text itself, which is novel. - The project's significance: a full formal grammar for MTG could enable automated verification of card interactions, smarter digital clients, or even help designers test hypothetical cards — but the game's complexity and edge cases make this extremely difficult.

Related stories