Markdown version: https://ai.hiina.space/reports/magic-circle-programming-languages.md · index

Index of everything on this site: https://ai.hiina.space/index.md

Magic circle programming languages

Can a programming language have a magic circle as its source code, drawn freehand in VR or photographed from ink on paper, and then executed? This report surveys the prior art (esoteric languages, Minecraft magic mods, gesture-casting games, fiction and medieval combinatorics), reviews what diagram recognisers and vision-language models can and cannot do in 2026, and proposes five circle languages, each with its own model of computation and its own answer to what "drawn well" should mean.

The motivating project is a VR spellcasting prototype that already recognises button-gated strokes and glyphs and computes per-stroke quality metrics; several recommendations below are framed as extensions of a prototype like that.

Contents

1. Summary

A programming language whose source is a magic circle is buildable, and the hard parts are smaller than they look: rings, angles, containment and vertex counts are cheap to recognise from strokes or a photo, while the things recognisers still get wrong (arbitrary line topology, tiny glyph detail) can be designed out of the notation. The closest prior art splits the problem in two. Mystical (Denis Moskowitz, 2025) draws PostScript as magic circles but has "no interpreter that will ingest a Mystical image" (Mystical README). The 2026 Witch Hat Atelier fan recognisers, led by wha-spell-simulator, go the other way: they turn a freehand ring and sigil into a GlyphAST and a SpellIR and run it, with neatness setting duration, but they support one ring and one sigil and record nested rings as unsupported (wha-spell-simulator). Hex Casting and Psi prove players will program diegetically, Noita proves a spell list can be an interpreter, and VIPR (1990s) is the one serious language built from nested rings. What nobody has built is a compositional circle language you can draw freehand, or photograph, and execute, with drawing quality wired into the semantics in a principled way. The five designs below fill that gap with five different computational models. Prototype Widdershins first: it is a stack language read counter-clockwise around a ring, where neatness lowers mana cost and mana doubles as gas, and it reuses almost all of an existing VR stroke-and-glyph recogniser. The one-evening experiment is to fit a ring to the first closed stroke, place four $Q glyphs around it, and measure whether angular order is a reliable program order.

Next section: https://ai.hiina.space/reports/magic-circle-programming-languages/02-every-existing-system-solves-one-half-of.md


Text licensed CC BY 4.0 (attribution: Hiina, ai.hiina.space). Source: https://github.com/hiinaspace/ai-hiina-space