Slashdot Mirror


Lisp as an Alternative to Java

Joseph Dale writes "Lisp as an Alternative to Java is a detailed and well-reasoned study comparing Lisp to Java and C++ in terms of execution time, memory consumption, and developer effort. The author, Erann Gat, was the principal software architect for the Mars Science Microrover, the prototype for the Mars Pathfinder rover."

8 of 372 comments (clear)

  1. Re:It's about the API by lars_stefan_axelsson · · Score: 2, Interesting
    Well, all that repetition that you claim one must do to program in Lisp (Scheme in my case) should translate to longer development times, shouldn't it?

    Then how do you explain that the development times reported for Lisp were about half those of Java, comparing the median?

    --
    Stefan Axelsson
  2. Smalltalk a better alternative to Java by Anonymous Coward · · Score: 1, Interesting

    In my opinion Smalltalk makes a much better alternative to Java.

    Smalltalk has all the trappings--a very rich set of base classes, byte-coded, garbage collected, etc.

    There are many Smalltalks out there...Smalltalk/X is quite good, and even has a Smalltalk-to-C compiler to boot. It's not totally free, but pretty cheap (and I believe for non-commercial use everything works but the S-to-C compiler).

    Squeak is an even better place to start...it is highly portable (moreso than Java), very extensible (thanks to VM plugins) and has as very active community that includes Alan Kay, the man who INVENTED the term "object-oriented programming". Squeak has a just-in-time compiler (JITTER), support for multiple front-ends, and can be tied to any kind of external libraries and DLL's. It's not GPL'd, but it is free under an old Apple license (I believe the only issue is with the fonts..they are still Apple fonts). It's already been ported to every platform I've ever seen, including the iPaq (both WinCE and Linux). It runs even on STOCK iPaqs (ie 32m) without any expansion...Java, from what I understand, still has big problems just running on the iPaq, not to mention unexpanded iPaqs.

    And of course, we can't forget about old GNU Smalltalk, which is still seeing development.

    Smalltalk is quite easy to learn--you can just pick up the old "Smalltalk-80: The Language" (Goldberg) and work right from there. Squeak already has two really good books that have just come into print (go to Amazon and search for Mark Guzdial).

    (this is not meant as a language flame...I'm just throwing this out on the table, since we're discussing alternatives to Java. Scheme/LISP is a cool idea as well, but I think Smalltalk deserves some mention.)

  3. Re:Interesting, but flawed? by nels_tomlinson · · Score: 3, Interesting
    Some of thing things I believe are more important when thinking about a programming language:


    1) Amenable to use by team of programmers
    2) Viability over a period of time (5-10 years).
    3) Large developer base
    4) Cross platform - not because I think cross-platform is a good thing by itself; rather, I think its important to avoid being locked-in to a single hardware or Operating System vendor.
    5) Mature IDE, debugging tools, and compilers.
    6) Wide applicability



    1) Is lisp less amenable to use by a team? Can't you implement one object while I implement another? I'm asking because I don't know; all my programming has been for my own research.

    2) Lisp has been around since the 1950's, in one form or another. I find that I can read lisp code from the Lisp 1.5 programmer's manual, which originated in 1965. Our kids will probably still be able to in another 30 years.

    3) How large is large enough? Is: "language of choice for 10^7 illiterate script-kiddies" a stronger recommendation than: "there are a sufficient number of competent programmers who are proficient in the language and familiar with the problem domain"? Notice that second statement is probably not true for any of the languages discussed, for most problem domains.

    4) Except for the Microsoft offerings, pretty much everything is cross platform. Think gcc and cmucl, for easy examples.

    5) I really don't know what an IDE is. I gather it is something other than emacs, since emacs supports nearly every language, some wonderfully well (try ESS for R). I really can't comment on this one at all; perhaps someone else could?
    As for mature compilers, again, I think all of the languages mentioned so far are in fair shape there. Java and c can both use the same back end in gcc, and so does gcl.

    6) Technically, all the languages mentioned are Turing-complete ... But wide applicability means being suitable, instead of merely capable. I am not familiar with java and c++, but lisp and c (and Fortran) seem to be equally capable for the bits of number crunching I do. Lisp is wonderfully more flexible, and the debug/wish-i'd-done-it-differently/change it/debug/repeat cycle seems a good deal shorter in Lisp than the other two, for me at least.

    After going over the above, it looks to me as if personal choice and the resources immediately at hand are really the only reasons to pick lisp over c over c++ over java over lisp.

  4. Re:LispM and Java hardware by Anonymous Coward · · Score: 1, Interesting

    Hardware lisp machines worked very well. It was over-pricing, marketing, not technological factors, that caused their failure.

    Thing is, a hardware design that runs lisp well also runs forth and Java well, anwyay -

    Java's already doing very well in the embedded field, largely because existing embedded forth controllers are good at executing java VM code - they're all just stack machines.

  5. Another factual reply goes under the radar by Anonymous Coward · · Score: 1, Interesting
    The mention of Stroustrup is interesting. Stroustrup has a very clear opinion of Java. http://www.research.att.com/~bs/bs_faq.html#Java shows this opinion.

    BTW, there is a link within that, which talks about how Java's handling of floating point is terrible and even sets back technology if fully endorsed by the industry and academia.

    Java is a very young language. It is easy for me to predict that in 30 years from now, that Java's library will be a mess. For instance, Sun will have theirs along with GNU's and also don't forget other meaningful re-implemented libraries by other communities (AI, Graphics, Scientic Computation, Multimedia, etc). Java is just beginning on a long trip through computer science.

    What has happened to Lisp? Algol? Smalltalk? Ada? Even C? Huge changes. That last paragraph talks about fragmentation? Let's see how Java (and C#)stand up to reality. BTW, Gosling has already said that many features should be added to Java. Read the link above for full details.

    This is not flamebait. This article should be modded up to a positive number. Act like an adult and do it.

  6. Re:What about GUIs? by prizog · · Score: 2, Interesting

    Java's event-driven GUI system is easy to code for, but is limited by the simplistic event model. Still, it does not make much totally impossible, so in my book, it is decent.

    I am not sure what you mean by a packing layout manager (but you can tell me next time you see me on IRC).

    I do see a list of toolkits, but they all seem to be based on terrible base toolkits, like Tk or WxWindows, or are not portable at all.

    CLIM is a good idea, but I cannot find any free (beer) implementations, which seriously limits its usefulness.

    Swing has the property that, since it is written almost entirely in Java, it can be ported with little effort. Bindings need not be written for each component, but only for windows (Xlib meaning) and a few other things. Unfortunately, this tends to make it a bit slow, but that's not a concern for me.

  7. Re:It's about the API by Anonymous Coward · · Score: 1, Interesting
    probably the kitchen sink too!

    That would be #'format, CL's answer to printf which can produce two different flavors of Roman numerals. The ANSI committee did go a little over the top in places....

  8. Re:I'm a professional who uses Java by sigue · · Score: 2, Interesting

    Right on the money, honey. I work at a company that has an e-commerce web site written in Common Lisp. When we got VC funding one of the requirements was that we eventually rewrite the whole thing in Java. Not for technical reasons, but because of their fear that we wouldn't be able to find enough good Lisp programmers. Well, we hired a boatload of Java programmers. They got approximately nothing done in about a year. We four Lisp hackers kept the site from grinding to a halt while they spent our money on Java dreams. VCs pulled out, we got rid of the Java programmers (and marketing spend-thrifts), we decided to continue with the conversion to Java, we generated 50K lines of Java code from the Lisp introspection facilities, we found that we had 10x code bloat in Java, dumped java, yay, back where we started, actually improving the site now!

    One striking thing was the complete lack of interest most of the Java programmers seemed to have in learning anything about the Lisp code. I guess they thought "how is this going to help my career"?

    Lisp is perfectly suited to web applications. Since it's mostly just application logic and sending bits out the wire, Lisp's ability to change code on the fly without restarting app servers and such is a huge win, especially since a web site often requires frequent, small updates.