The Accumulator Generator: Java and Lisp: Comments

Paul Graham was kind enough to provide the following comments:

Well written. But one reason I felt safe dissing Java is that I had inside information from one of the Java designers. He said that he'd lobbied for support for lexical closures in Java, but they never got around to including them because of fears that they'd be hard to implement. So Java's performance in this test is less a result of a conscious philosophy than you might think.

As for static vs. dynamic typing, I think you mischaracterize the difference. You can still make compile-time declarations for any variable in dynamic languages-- or at least, in Common Lisp. So static languages are no safer. The difference is just that in dynamic languages, declarations are optional, and in static languages they're required.

There is one difference in performance as a result of this choice, though. In a static langauge, you can't create something that you can't describe at compile time. For example, you can't generally create a list of varying types of objects. Users of dynamic languages do this sort of thing constantly, and not being able to would be a great restriction. Among other things, it would make it hard to write programs that manipulate programs, because you couldn't represent parse trees.

(You're welcome to include the foregoing as an appendix to your article.)

--pg


back to The Accumulator Generator: Java and Lisp