In computer programming, homoiconicity
is a property of some programming languages
, in which the primary representation of programs is also a data structure
in a primitive type
of the language itself, from homo
meaning the same
The original source is the paper Macro Instruction Extensions of Compiler Languages
, according to the early and influential paper TRAC, A Text-Handling Language
Alan Kay used and possibly popularized the term "homoiconic" through his use of the term in his 1969 PhD thesis:
Use and Advantages
One advantage of homoiconicity is that extending the language with new concepts typically becomes simpler, as data representing code can be passed between the meta and base layer of the program. A typical demonstration of homoiconicity is the metacircular interpreter.
Languages which are considered to be homoiconic include most members of the Lisp family, Prolog, Smalltalk, Curl, REBOL, SNOBOL, XSLT, TRAC, Tcl, Io, Joy, Factor, Clojure, PostScript and V.
In Von Neumann architecture systems (including the vast majority of systems today), raw machine code also has this property, the data type being bytes in memory.