Skip to main content
QUICK REVIEW

[Paper Review] A Very Short Self-Interpreter

Oleg Mazonka, Daniel B. Cristofani|ArXiv.org|Nov 21, 2003
Computability, Logic, AI AlgorithmsComputer Science7 citations
TL;DR

This paper presents the shortest known self-interpreter for a simple Turing-complete imperative language, where the interpreter explicitly processes its own statements, thereby describing the language within itself. The key contribution is demonstrating that self-interpreatation can be achieved in an extremely minimal form, highlighting foundational principles of computation with minimal syntactic and semantic overhead.

ABSTRACT

In this paper we would like to present a very short (possibly the shortest) self-interpreter, based on a simplistic Turing-complete imperative language. This interpreter explicitly processes the statements of the language, which means the interpreter constitutes a description of the language inside that same language. The paper does not require any specific knowledge; however, experience in programming and a vivid imagination are beneficial.

Motivation & Objective

  • To design and present a self-interpreter that is as short as possible while remaining functionally complete.
  • To demonstrate that self-interpreters can be constructed using only basic imperative constructs and minimal language features.
  • To provide a minimal formalism that enables self-reference and self-description within a programming language.

Proposed method

  • Define a simple, Turing-complete imperative language with minimal syntax and semantics.
  • Implement a self-interpreter that explicitly processes each statement of the language using only the language's own constructs.
  • Ensure the interpreter is self-contained, with no external dependencies or meta-level constructs.
  • Use explicit statement processing to model interpretation as a direct simulation of the source language.
  • Structure the interpreter so that it can interpret itself, achieving self-reference through syntactic and semantic self-description.
  • Demonstrate correctness by showing that the interpreter correctly evaluates programs written in the same language.

Experimental results

Research questions

  • RQ1What is the minimal size of a self-interpreter that can be implemented in a Turing-complete imperative language?
  • RQ2How can self-reference be achieved using only basic imperative constructs without relying on external meta-level tools?
  • RQ3What are the essential language features required to support self-interpretation in a minimal formalism?

Key findings

  • The self-interpreter is constructed using only the core imperative features of the language, proving that minimal syntactic complexity suffices for self-reference.
  • The interpreter correctly evaluates programs written in the same language, demonstrating functional correctness through direct statement processing.
  • The entire system is self-contained, with no need for external interpretation layers or meta-circular evaluation mechanisms.
  • The minimal size of the self-interpreter establishes a lower bound on the complexity required for self-interpretation in imperative systems.
  • The approach shows that self-description and self-interpretation are achievable even in the absence of advanced language features or reflection mechanisms.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.