N-queens solved entirely in Python type annotations with ty, each solution a tuple
charliermarsh · x · 2026-10-28
Charlie Marsh (Astral) shared an N-queens solver written purely in Python type annotations, powered by the ty type checker. There is no runtime logic — the search happens entirely at the type level, supporting arbitrary Peano-encoded board sizes, with each tuple in the revealed type representing one valid solution. The full 45-line implementation showcases ty's inference on deep recursive types.
More from coding & agent
- ai-design-skills rockets to 9.1k GitHub stars with 1,395 stars in a single day — elayadesign · 2026-10-28
- EmbeddingGemma2 Turned Into a 20ms Real-Time Trainable Multimodal Endpoint on CPU — michellechen · 2026-10-28
- Anthropic hiring manager kills the coding interview: "It no longer provides signal" — felixrieseberg · 2026-10-28
- Nous' memelord Goes Beyond Research, Now Hookable via MCP — alexcovo_eth · 2026-10-28
- Custom node pack brings looping H3 video generation to Comfy Cloud — PurzBeats · 2026-10-28
- Chaosfolk: open-source tool sics 16 AI personas on your web app to break it — Vjeux · 2026-10-28