Don't Say "Homoiconic"

tags
Homoiconicity

cf Homoiconicity revisited

Notes

Historic de�nition

NOTER_PAGE: (2 . 0.08919803600654665)

The external and internal forms of the TRAC language are the same.

NOTER_PAGE: (2 . 0.4165302782324059)

the importance of a single representation for viewing and manipulation by the user and interpretation by the computer is repeated no less than 5 times

NOTER_PAGE: (2 . 0.5008183306055647)

TRAC procedures and text have the same representation inside and outside the processor

NOTER_PAGE: (3 . 0.19885433715220951)

“Code as data”

NOTER_PAGE: (3 . 0.5957446808510639)

any attempt to explain homoiconicity by using the phrase “Code as data” is quite meaningless.

NOTER_PAGE: (3 . 0.6415711947626842)

homoiconicity is “code as data”, and “code as data” is homoiconicity, we’ve simply created a circular definition

NOTER_PAGE: (4 . 0.058919803600654665)

Program structure & syntax

NOTER_PAGE: (4 . 0.23567921440261866)

program structure is similar to its syntax

NOTER_PAGE: (4 . 0.40180032733224225)

which program are we talking about as a reference for comparison?

NOTER_PAGE: (4 . 0.7945990180032734)

what would the measure of similarity across these 2 levels of abstraction be?

NOTER_PAGE: (4 . 0.8191489361702128)

abstract syntax tree is by de�nition a representation of the structure of the language text.

NOTER_PAGE: (5 . 0.14402618657937807)

Meta-circular evaluator

NOTER_PAGE: (5 . 0.32896890343698854)

Primitive data types

NOTER_PAGE: (6 . 0.41489361702127664)

most languages have a primitive datatype for strings of text, and the programs in most languages are presented to the user as a string of text. Should we conclude from this that most languages are homoiconic?

NOTER_PAGE: (6 . 0.7324058919803601)

for most languages, it is possible to write a parser in that language itself

NOTER_PAGE: (6 . 0.8764320785597381)

Now we know what homoiconicity is not, the way is cleared for a discussion on what it is.

NOTER_PAGE: (7 . 0.33060556464811786)

the original de�nition of homoiconicity centers on a similarity between the internal and external representations of a language.

NOTER_PAGE: (7 . 0.38543371522094927)

a typical program in Lisp is represented to the programmer as nothing more than an s-expression.

NOTER_PAGE: (7 . 0.6153846153846154)

the (virtual) machine operates on s-expressions directly

NOTER_PAGE: (7 . 0.8690671031096563)

Objections

NOTER_PAGE: (8 . 0.19067103109656303)

in practical environments the external representation is not an s-expression, but text.

NOTER_PAGE: (8 . 0.4811783960720131)

Practical implementations of Lisp interpreters do generally not operate actually directly on s-expressions internally for performance reasons.

NOTER_PAGE: (8 . 0.590834697217676)

Para-iconic

NOTER_PAGE: (8 . 0.8060556464811784)

homoiconicity is not a boolean property, but a scalar one

NOTER_PAGE: (8 . 0.8764320785597381)

parsing of s-expressions is trivial, as is the reverse operation of converting s-expressions to some printable form.

NOTER_PAGE: (9 . 0.39689034369885434)

to say that the external representation of a Lisp program is an s-expression holds at least some truth.

NOTER_PAGE: (9 . 0.5130932896890344)

Any properly implemented optimization will have the same behavior (barring performance) as its non- optimized counterpart.

NOTER_PAGE: (9 . 0.6800327332242226)

Strings of text and machine code are quite dissimilar, and to map between them takes considerable e�ort.

NOTER_PAGE: (10 . 0.06219312602291326)

I’d say it’s much easier to just talk about certain properties of your favorite language directly.

NOTER_PAGE: (10 . 0.7798690671031097)

Afterword: L. Peter Deutsch responds

NOTER_PAGE: (11 . 0.18985270049099837)

“WYSIWYG” in the context of text editing is arguably the same idea as “homoiconic” in the context of programming

NOTER_PAGE: (11 . 0.560556464811784)

for a well-encapsulated machine, we cannot observe its inner workings by de�nition; in that view, making any statement about the internal representation of the machine is meaningless.

NOTER_PAGE: (13 . 0.06219312602291326)

In fact, there is a whole chain of representations, including electrons in the brain of the programmer, photons emitted from the screen, program text, machine code, and electrons moving in the CPU.

NOTER_PAGE: (13 . 0.2274959083469722)