Tuesday, May 09, 2006

What's LISP got to do with it?

One of the strengths of lisp is the fact the control structure uses the same syntax as the data structure -- a notion similar to the relationship between binary computer instructions and data (the same set of bits can be either one.)

If all non-lisp programmers continued to program in machine language, they would enjoy the same benefits as lisp programmers.

So, the question arises, "What would a Java-like language have to be like in order to enjoy this strength of lisp?"

First an analysis of this code/data relationship in lisp. There is a direct relationship between the written form of the language and its "stored program structure" that matches the relationship between the written form of data structures and their "stored data structure". This illusion is created by the reader, that translates both code and data into its internal format. It represents a universal abstraction because indeed the internal stored formats do not have to be what they appear, but it is true that the car of a program is just as well understood as the car of a list.

Now, consider, what is there in a language like Java and its data structures that can be in such an equivalence as lisp's code and data? Well, perhaps it would be easier to answer if we first removed the veil of compliation and viewed the languages as being interpreted, with no underlying bytecodes to make us wonder if bytecodes can be manipulated like numbers.

Done. What is left? When the text of the language creates "code", it is making classes. Well there are also interfaces, but let's leave that be for now. When the text of the language creates "data" it should also be able to make classes!

No comments: