Saturday, July 09, 2005

I've been going deeper into Java, trying to figure it all out, and the more I do, the more it looks inherently different from Lisp. Basically, I'm not so sure it's a good idea to do a direct-to-.class file Lisp. It might work, but I've got more learning to do, for sure.

In the meantime, I found a nice (actively developed) Java-based lisp interpreter called Armed Bear Common Lisp (ABCL).

Something else I've been thinking of lately is how much wasted code there is. I've heard the quote:

"Programs must be written for people to read, and only incidentally for machines to execute."

- Abelson & Sussman, SICP, preface to the first edition

But I'm not so sure I believe it. If I were to be quoted, I think it would sound better as:

"Readers (a.k.a. compilers) must be written for people to program, and only incidentally for others to make sense of."

The fundamental difference is the purpose of the program. The first implies that the first purpose is for other people to read programs. However, I can say with certainty that the large majority of people prefer to use programs rather than read source code. That said, the fundamental purpose of the program is to be used. And if it is easy for people to write programs, it is easy for people to communicate concepts and ideas to others in an easy-to-digest manner. The programs that help us do this, I classify as compilers.

Under this definition, we find that not only are C compilers and the like within the definition, but we also find word processors and email programs. Indeed, these programs help us compile our thoughts into discrete words, which we can transmit to others to widen their breadth of information.

But I digress...while it makes sense to have some readability of code, it also makes sense to have more compact code. For example, the latest download of the Fedora Core iso files takes 4 discs. I cannot possibly imagine that all of that is really necessary. I imagine that somewhere, some program wrote from scratch a necessary function which duplicated another function for another program. In fact, I imagine this happens hundreds of times, if not more. What if instead this series of statements was recognized as "common" and put into a library. Indeed, what if this were done for thousands of functions and programs. With today's availability of memory, it might be possible to significantly lower hard drive accesses, because only user data and program-specific code would need to be fetched. Also, handheld devices would benefit, as they could hold a lot more programs per megabyte.

If anyone knows of such a program, please let me know, as I'd be interested in it...


Post a Comment

<< Home