Tibor's Musings

Programming Language for Rapid Prototyping

Programming languages suitable for rapid prototyping or why I prefer Lisp and Python to Java.

I think one of the essential needs in programming is the ability to create fast prototypes, to test ideas, to throw some of them, and retain the good ones. Java is not good at this. It's far behind Common Lisp, Objective Caml or Python. I particularly like Common Lisp as it enables you for example to dynamically change your code during runtime. For example, you modify a class in a running Lisp image, and all its instances are modified accordingly, in the runtime. No need to remember the current debugging state, quit, edit, recompile, restore state, and retest if it works this time!

A good article on this is "Accelerating Hindsight: Lisp as a Vehicle for Rapid Prototyping" by Kent Pitman. The article is written in 1994 so it says "weird" things like "Hash Tables: widely accepted data structures for fast access to large tables of data are not present in most languages, but are standard in Common Lisp". Nowadays most languages have "caught up" in this respect. But I think they did not catch up in most of other points, far from that. His conclusions are still valid. http://world.std.com/%7Epitman/PS/Hindsight.html

There is a nice real-world "proof" of this Lispy claim: see a somewhat simplified measuring of programmer's efficiency in Java, C++ and Lisp for a sample task, presented in the paper "Lisp as an Alternative to Java" by Erann Gat http://www.flownet.com/gat/papers/lisp-java.pdf. Concerning this study, Peter Norvig writes:

I did not participate in the study, but after I saw it, I wrote my version in Lisp. It took me about 2 hours (compared to a range of 2 to 8.5 hours for the other Lisp programmers in the study, 3 to 25 for C/C++ and 4 to 63 for Java) and I ended up with 45 non-comment non-blank lines (compared with a range of 51 to 182 for Lisp, and 107 to 614 for the other languages). (That means that some Java programmer was spending 13 lines and 84 minutes to provide the functionality of each line of my Lisp program.)

http://www.norvig.com/java-lisp.html

programming