Lisp, Java, and C++
Scott L. Burson
gyro@zeta-soft.com
Tue, 27 May 1997 00:51:52 -0700 (PDT)
From: Chris Bitmead uid <chris.bitmead@alcatel.com.au> (x22068)
Date: Tue, 27 May 1997 15:03:13 +1000
>I think Java is *much* closer to Lisp than to C++. Don't be misled by the
>strong typing. The variable binding model is that of Lisp (in particular,
>pointers are hidden from the programmer); it's safe; it's GCed. Because of
>the strong typing, polymorphism is more restricted than in Lisp, but it's
>entirely adequate for writing real programs.
>
>I guess if C++ and CLOS were your primary exposures to object-oriented
>programming, you might think that Java was more like C++. Certainly Java's
>OOP model is not much like CLOS's. But there have been a variety of OOP
>subsystems for Lisp, and Java is relatively close to some of them.
The most significant criteria for positioning a language, in my view
is either supports/does not support functional programming well.
As far as I can tell, Java doesn't support functional programming very
well, but then again, I havn't really tried.
Java doesn't particularly *encourage* a functional style, but any language
with a GC supports FP much better than any language without it. (You can fake
GC in C++ using reference counting, but it's a pain.)
Anyhow, I wouldn't have said FP is what makes Lisp Lisp. I don't think Lisp's
support for FP is all that great -- Prolog's is better, for instance.
Still, it's true, large Lisp programs usually have lots of little pockets of
functional code, which is not a style you would be likely to find in Java
code, although with sufficient determination you could write it that way.
>And consider this: implementing Java in Lisp would be far easier than
>implementing C++ in Lisp.
Is there any programming task _not_ easier than implementing C++?
Sure -- Ada :-)
Well, okay, I should have said "... would be easier than implementing *C* in
Lisp". Since I actually did the latter, I can tell you it's no walk in the
park.
-- Scott