Hacker News new | ask | show | jobs
by minism 621 days ago
Right, but isn't it a problem that a quine also requires the information contained in the language's compiler/interpreter to be fully meaningful? This would be "outside the universe" so to speak.
2 comments

A minimal quine just prints itself out as "source" code. You can choose the source language to be whatever you like, such as a minimal Turing complete combinator. So all you need is an interpreter for the base level, which could be something as simple as Rule 110[1].

It really doesn't matter what Turing-complete language you choose; they can all be implemented in terms of each other, so as soon as you have your quine one language you could as well do it any other.

[1] https://en.wikipedia.org/wiki/Rule_110

Compilers are just translators. Which is why it's not too hard to write a compiler in the language that the compiler itself implements.

An assembly quine is an odd thing to even ponder.

Sort of. The very first compiled binary of any new language has to first be written in a language that already has a compiler, and the very first compiler of any high-level language at all had to be written in assembler.

Ultimately, if you can't write a Quine directly in logic gates, which you can't because no microprocessor can output another microprocessor, you need something external to the "universe" of the language.

> has to first be written in a language that already has a compiler

You only need an interpreter for that language.