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."

10 of 372 comments (clear)

  1. I'm a professional who uses Java by under_score · · Score: 5, Informative

    This is quite an interesting study. I use java professionally for most things that I do (I have also used C, Objective-C and a few others in the past). I have had to work with lisp a bit. Of course I took a lisp oriented AI class in school, but since then I have also had to do some porting from lisp to Java! Perhaps it was just a factor of the people who developed the lisp code, but I found it incredibly difficult to read - and my complaint wasn't with the nesting of parentheses. It wasn't strongly typed (is there such a lisp?) and the singular type of syntax (lists) make many aspects of the code difficult to unravel. That said, there are some things I really like about lisp, in particular its dynamic nature where you can build lisp functions at runtime and execute them at runtime. Sometimes I really wish I could do this easily with Java (its possible to do, just a huge pain in the butt). I think the real issue right now is that Java (and C++) are used in the "real world", whereas lisp is mostly isolated to academia. The article point this out. I've used Java for huge projects because it is no longer considered a risky language by large organizations. For whatever reason, lisp has not developed such a reputation. Does lisp have application servers? Does lisp has db connectivity? Does lisp have CORBA bindings? Does lisp have asynchronous messaging? Does lisp have naming and directory bindings? Does lisp have web page templating functionality? I'm sure all that stuff could be built, but I doubt most of it exists right now. Therefore, lisp is not acceptable for corporate use at this time.

    1. Re:I'm a professional who uses Java by Lambdaknight · · Score: 5, Informative

      > Does lisp have application servers?

      Yes

      > Does lisp has db connectivity?

      Yes

      > Does lisp have CORBA bindings?

      Yes

      > Does lisp have asynchronous messaging?

      Yes

      > Does lisp have naming and directory bindings?

      Yes

      > Does lisp have web page templating functionality?

      Yes.

      Two points more:

      1. Doubt is not knowledge. Many people THINK they know about the popularity of Lisp because they don't hear as much about it as they hear from the hype languages (which is quite logical).

      There are far more Lisp projects going on than people imagine, only people don't scream out "HEY! COOL! I'M DOING IT WITH LISP!" they go "Yepp, I'm using Lisp." the Yahoo Store engine for instance. Microsoft's Bob. Many industrial applications (not only the academia!).

      2. The syntax isn't hard to read, it's just hard for people not used to it. This is, of course, true for every language.

      Besides: Common Lisp is not strongly typed but you can strongly type a specific function by declaring what types the arguments will have. That makes Lisp a "strong typing on demand"-language in my point of view.

      --
      -- Beware the Jabberwock, my son!
  2. Re:It's about the API by redhog · · Score: 5, Informative

    Nahnah. You haven't touched a LISP the last 20 years or so, have you? There's a popular LISP dialect called Scheme. It has a huge function library called slib, and there are bindings for a hell lot of C libraries for Scheme (it is also very easy to create new such bindings for most implementations of scheme).

    --
    --The knowledge that you are an idiot, is what distinguishes you from one.
  3. Re:Learning Lisp? by Lambdaknight · · Score: 3, Informative

    Yes.

    Read "Structure and Interpretation of Computer Programs" by Abelson and Sussman.

    It is a fabulous book for introduction into functional thinking and shows many enlightening things about what you can do with Lisp in general and in this case Scheme.

    Your next step might be "ANSI Common Lisp" by Paul Graham, giving an introduction into the Lisp dialect with which major applications in the industry are done (REALLY done, Franz Inc. and Xanalys, both commercial Lisp implementors and vendors have increasing sales over the years) - also a very clear and easy to follow book with lots of examples and exercises and a very cool reference which I tend to use a lot while Lisp coding.

    If you prefer online information, you can find many links and pointers to Lisp on the webpage of the Association of Lisp Users (ALU, http://www.alu.org).

    (Yes, I'm paid to code in Lisp)
    (Yes, it's a lot of fun)

    --
    -- Beware the Jabberwock, my son!
  4. There is more data available for other languages.. by crealf · · Score: 5, Informative
    The article about Lisp is a follow-up of an article by Lutz Prechelt in CACM99 (a draft is available on his page along with other articles).

    However there is more data now, as, Prechelt itself widdened the study, and published in 2000 An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl (a detailed technical report is here).

    If you look, from the developer point of view, Python and Perl work times are similar to those of Lisp, along with program sizes.
    Of course, from the speed point of view, in the test, none of the scripting language could compete with Lisp.

    Anyway some articles by Prechelt are interesting too (as many other research papers ; found via citeseer for instance)

  5. Re:Writeability vs. Readability of LISP/JAVA by jonathan_ingram · · Score: 3, Informative

    Recursion is neither evil nor unnatural. It's the natural way to define many things.

    For example, what's the natural way to define the factorial, n! ?

    0! = 1
    n! = n * (n-1)! if n > 0

    Clear and simple.

    Suppose I have to perform a function on every node of a rooted tree:

    starting with the root:

    walk through any children.
    process the current node.

    And that will translate directly into clear and easy to understand (and easy to debug) code.

    You think and use recursion every day, you just don't recognise it. That's not to say that recursion is the only thing that should be used, but when used correctly it makes code very easy to understand.

  6. Re:It's about the API by gawi · · Score: 5, Informative

    From what I've seen of SLIB, it is not comparable with the Java 2 platform (standard edition) version 1.4. :

    Threads

    I/O (blocking or non)

    Reflection API

    Weak references (and the likes)

    Networking (including http client, ipv6 support, URLs, datagrams, network interface)

    RPC (RMI, CORBA)

    Security (permission, keys)

    Relational database API (implemented by MANY vendors, you can often *choose* your implementation...)

    Text formatting

    Data structures (OK, needs functional improvements, I agree)

    Useful classes: date, calendar, locale, time zones, currency, timer...

    Logging

    Regexp

    Zip

    Preferences

    Accessibility

    Imaging API

    Naming API (directories, ldap)

    Printing API

    GUI API (awt, Swing)

    XML parser + DOM + SAX

    XSLT

    Components (java beans)

    Sound

    Should I continue with enterprise edition?

    I think no langage can compete with Java in terms of API richness and uniformity.

    --
    All humans are mortal. Socrates is a human. Socrates is dead.
  7. I've written 2 Lisp and 4 Java books by MarkWatson · · Score: 4, Informative
    First, great topic!

    I have written 2 Lisp books for Springer-Verlag and 4 Java books, so you bet that I have an opinion on my two favorite languages.

    First, given free choice, I would use Common LISP for most of my devlopment work. Common LISP has a huge library and is a very stable language. Although I prefer Xanalys LispWorks, there are also good free Common LISP systems.

    Java is also a great language, mainly because of the awesome class libraries and the J2EE framework (I am biased here because I am just finishing up writing a J2EE book).

    Peter Norvig once made a great comment on Java and Lisp (roughly quoting him): Java is only half as good as Lisp for AI but that is good enough.

    Anyway, I find that both Java and Common LISP are very efficient environments to code in. I only use Java for my work because that is what my customers want.

    BTW, I have a new free web book on Java and AI on my web site - help yourself!

    Best regards,

    Mark

    -- www.markwatson.com -- Open Source and Content

  8. Why Java succeeded, LISP can't make headway now by joneshenry · · Score: 5, Informative
    Java was never marketted as the ultimate fast language to do searching or to manipulate large data structures. What Java was marketted as was a language that was good enough for programming paradigms popular at the time such as object orientation and automatic garbage collection while providing the most comprehensive APIs under the control of one entity who would continue to push the extension of those APIs.

    In this LinuxWorld interview look what Stroustrup is hoping to someday have in the C++ standard for libraries. It's a joke, almost all of those features are already in Java. As Stroustrup says, a standard GUI framework is not "politically feasible".

    Now go listen to what Linux Torvalds is saying about what he finds to be the most exciting thing to happen to Linux the past year. Hint, it's not the completion of the kernel 2.4.x, it's KDE. The foundation of KDE's success is the triumph of Qt as the de facto standard that a large community has embraced to build an entire reimplementation of end user applications.

    To fill the void of a standard GUI framework for C++, Microsoft has dictated a set of de facto standards for Windows, and Trolltech has successfully pushed Qt as the de facto standard for Linux.

    I claim that as a whole the programming community doesn't care whether a standard is de jure or de facto, but they do care that SOME standard exists. When it comes to talking people into making the investment of time and money to learn a platform on which to base their careers, a multitude of incompatible choices is NOT the way to market.

    I find talking about LISP as one language compared to Java to be a complete joke. Whose LISP? Scheme? Whose version of Scheme, GNU's Guile? Is the Elisp in Emacs the most widely distributed implementation of LISP? Can Emacs be rewritten using Guile? What is the GUI framework for all of LISP? Anyone come up with a set of LISP APIs that are the equivalent of J2EE or Jini?

    I find it extremely disheartening that the same people who can grasp the argument that the value of networks lies in the communication people can do are incapable of applying the same reasoning to programming languages. Is it that hard to read Odlyzko and not see that people just want to do the same thing with programming languages--talk among themselves. The modern paradigm for software where the money is being made is getting things to work with each other. Dinosaur languages that wait around for decades while slow bureaucratic committees create nonsolutions are going to get stomped by faster moving mammals such as Java pushed by single-decision vendors. And so are fragmented languages with a multitude of incompatible and incomplete implementations such as LISP.

  9. Re:Writeability vs. Readability of LISP/JAVA by hding · · Score: 3, Informative

    Why is it relevant how readable a program written in some language one doesn't know is? I don't think there's anything wrong with Russian because I can't gain any understanding from looking at a Russian text. I think people who know (i.e. use regularly, not studied for two weeks one semester in school) Lisp find it perfectly readable.