# A Quine Built from Kleene's Second Recursion Theorem, Formalized in Rocq

Original title: Constructing a Quine from Kleene's Second Recursion Theorem

> Hacker News story 50321436 · language: en · submitted 2026-10-31
> Web version: https://zeli.app/story/50321436
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 21 · by [mkckto](<https://news.ycombinator.com/user?id=mkckto>) · 💬 1
[original](<https://emarzion.github.io/KSRT/>) · [HN discussion](<https://news.ycombinator.com/item?id=50321436>)

## Summary

Kleene's second recursion theorem guarantees that quines exist, but how hard is it to actually build one from the construction? The author walks through a functional-programming presentation of the theorem, then implements it in the untyped lambda calculus using Church encodings for syntax trees and a quasi-quoter, and verifies the whole thing in Rocq. Along the way, typed and untyped views connect the theorem to Gödel's diagonal lemma and Tarski's undefinability theorem.

## Key quote

> Far from being a mechanical chore, the act of formalization can actually be a source of insight and creativity.

---

## Cite

- Page: https://zeli.app/story/50321436
- Date: 2026-10-31
- Source: emarzion.github.io (https://emarzion.github.io/KSRT/)
- Hacker News: https://news.ycombinator.com/item?id=50321436

## Other languages

- zh: https://zeli.app/zh/story/50321436 · markdown: https://zeli.app/zh/story/50321436.md
- ja: https://zeli.app/ja/story/50321436 · markdown: https://zeli.app/ja/story/50321436.md
- ko: https://zeli.app/ko/story/50321436 · markdown: https://zeli.app/ko/story/50321436.md
- de: https://zeli.app/de/story/50321436 · markdown: https://zeli.app/de/story/50321436.md
- es: https://zeli.app/es/story/50321436 · markdown: https://zeli.app/es/story/50321436.md
- ru: https://zeli.app/ru/story/50321436 · markdown: https://zeli.app/ru/story/50321436.md
