Time to learn LISP

Time to learn LISP

Summary: Peter Coffee has an interesting article about "exotic" programming languages (and techniques) that are being used in mainstream applications.  Peter mentions LISP, Prolog, genetic programming, and neural nets as examples.

SHARE:

Peter Coffee has an interesting article about "exotic" programming languages (and techniques) that are being used in mainstream applications.  Peter mentions LISP, Prolog, genetic programming, and neural nets as examples.  I've done my share of programming in a dialect of LISP called Scheme and think there are compelling reasons for increased adoption of these languages and techniques in Web-facing applications. 

One of the biggest complaints against these "exotic" languages and techniques was performance.  But, as Peter mentions, the tools, and particularly the libraries, are getting much better.  As people have moved more and more to interpreted languages like Perl, Python, Ruby, and even Java (with it's VM), the performance hurdle has been crossed.  For many applications, programmers are more interested in useful tools than in squeezing out  the last ounce of performance.

Unfamiliarity is always a problem, but again, languages like Perl, Ruby and Python are exposing programmers to concepts and techniques that more mainstream languages like Java or C# hide.  Closures, unnamed procedures, continuations, and so on are some that spring to mind.  People have always complained about the syntax (or lack thereof) in LISP, but XML's strange syntax proves that you can get over even that hurdle.

Lately, I've been noticing people in areas outside machine learning pick up neural nets to solve problems in their specific domain.  There are some interesting user interface problems, for example, that are amenable to machine learning.  Often, if you've got a way to collect "learning data" from users, you can configure software as if by magic, just from watching user actions. 

To be sure, LISP and other "exotic" techniques, aren't going to replace Java or ASP.NET anytime soon as the dominant development methodology, but that's hardly the point.  As Paul Graham has rightly pointed out: popularity isn't the same as greatness.   

Topic: Software Development

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.

Talkback

8 comments
Log in or register to join the discussion
  • Long and Interesting Thread on Dynamic Languages vs Java

    http://www.theserverside.com/news/thread.tss?thread_id=37121
    Erik1234
  • recent blog posts

    You may also be interested in these posts from the past few weeks:

    The Perils of JavaSchools
    http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
    By Joel Spolsky
    Thursday, December 29, 2005

    Lisp is sin
    http://blogs.msdn.com/sriram/archive/2006/01/15/lisp_is_sin.aspx
    By Sriram Krishnan
    Sunday, January 15, 2006

    They got me interested enough to check out the MIT course online:
    http://swiss.csail.mit.edu/classes/6.001/abelson-sussman-lectures/
    and the book: http://mitpress.mit.edu/sicp

    Also available online for free:
    http://mitpress.mit.edu/sicp/full-text/book/book.html

    Although Sriram said Norvig's book is better:
    http://www.amazon.com/gp/product/1558601910/002-6413815-3000828?v=glance&n=283155
    GLuft3
  • I've actually been looking into Lisp lately...

    This was a timely blog for me. I've been doing a lot of reading about Lisp lately, especially Mr. Graham's website. I did some work in Scheme a while back, and really liked it. It was elegant, and easy to write code in.

    One feature that Lisp and Perl have, that is impossible to do in a compiled language (or nearly impossible to do, without a lot of hassle and maybe some JIT'ing) is eval(). eval() is simply the most powerful tool at a programmer's disposal. I cannot count the number of times I saved dozens, if not hundreds of lines of code with eval().

    For example, I wrote a little "framework" in Perl to act as a rudimentary shopping cart and CMS. It was trivial to allow embedded code of the <? code... ?> variety, in just ONE line of code: $template =~ s/<\?(.*?)\?>/$1/emx (or something along those lines, my Perlish regex is a little rusty at the moment). Basically, it says, "whenever you see something surrounded by '<?' and '?>', execute it and put the final result into the output at the exact same spot". Sure, it wasn't 100% perfect, as far as frameworks go, but I sure could do a lot with that little system.

    I have been "forced" to be programming in Java, VB.Net, VBScript, VBA, PHP (well, I know PHP has eval(), and there's nothing wrong with PHP, except for the way people write code in it...), ASP, and ASP.Net for so long now, I am convinced that I am becoming dumber. It is now second nature to spend half a day wondering if something should be implemented as a class, or if I should first make an interface and then abstract it, on the off chance I may have to make something similar to it down the road...

    More importantly, I would like to be doing more "intelligent" programming, along the lines of AI, computer generated patterns (it's one thing to have a computer match patterns, another for it to invent them based upon data sets) and so forth. The "mainstream" languages are just no good for this kind of work.

    J.Ja
    Justin James
    • Static vs. Dynamic Typing

      <i>It is now second nature to spend half a day wondering if something should be implemented as a class, or if I should first make an interface and then abstract it, on the off chance I may have to make something similar to it down the road...</i>

      I was pondering the same thing yesterday in relation to why dynamic typing feels more efficient in terms of programmer time than dynamic typing.

      Static typing has two purposes:
      1. It enables the compiler to enforce the contract you define via your class/interface (and it's a weak for of dbc at that)
      2. It enables the compiler to use static or virtual method invocation instead of dynamic (i.e. an optimization to make method invokation faster)

      The problem is at the early stages of programming you don't know what the contract should be (well, maybe you have a big UML diagram that tells you, but who knows if it's right) and you certainly aren't ready to optimize your code.

      Don't get me wrong, I think static typing is very useful. I just think it should come somewhere between "the code pretty much works" and "the code is ready for release."
      Erik1234
  • Haven't done LISP

    Since my early days with AutoCAD's AutoLISP. To me, its JAPL (Just another programming language).
    Roger Ramjet
    • Hate profiliferation of "me too" languages as well...

      I've seen you post failrly frequently on the Y/JAPL issue, and I tend to agree with you. That being said, the problem with simply saying "JAPL" is that different languages do different things. For example, it does not matter what language you write your application in, chances are, it is going to make database queries using SQL. Is SQL JAPL? Sure it is. But the only language I can think of off the top of my head that was as data-centric (and as useless, except to deal with nearly raw data) as SQL was COBOL.

      Another great example here is Perl. Perl is absolutely amazing for handling text. Sure, roughly 90% or so of it's typical functionality exists in VB or C++ or Java, or whatever. But try to implement that level of text processing in a different language, particularly an OO one, you'll see what I mean. A while back, I re-wrote the Perl Soundex module in VB.Net. The number of lines of code multiplied by quite a number of factors, and the execution speed was miserable. Would I use Perl for general purpose language? No thanks, I remember 1997 quite well, and writing CGI scripts for websites is something I would rather not repeat. Would I use Perl as something to be called by another program, or for a small standalone piece of code? Without hesitation.

      Java is a pretty good general purpose language. So is VB.Net (VB prior to .Net was pretty lousy, IMHO). In my mind, their functionality is pretty much interchangable. VB.Net is friendlier, in large part because the .Net framwork makes life incredibly easy. But that's the nature of the beast, as Java isn't as tied to the OS as .Net is.

      My point is, JAPL is definitely an issue. But only within particular categories of languages. For example, in the Lisp category, do they *really* need Lisp, Scheme, AutoLisp, and a zillion other varients? Probably not. Does the world need Java AND a zillion different Microsoft implementations of it? Not really, except for legalities.

      At the end of the day, it is pretty silly to use a different langauge for the sake of being different. But there is a lot to be said for various languages/classes of languages, and Lisp is in a category that is nothing like most other languages, it certainly isn't JAPL.

      J.Ja
      Justin James
  • forget LISP!

    it's pretty ironic that the best and most widely used (see Netcraft stats) web scripting language of them all, PHP, wasn't even mentioned here.

    PHP was built from the ground up to do one thing - script web sites. it's easy to learn, allows seamless connection to most RDBMS and it's very hard to beat.

    python-java lover bruce eckel said it best - if all you want to do is put up a website that accesses a backend DB, then it's hard to figure why you'd use anything other than PHP.

    maybe that's why IBM and Oracle just annointed PHP as the way to go for web programming.

    and maybe that's why this very blog is scripted in....PHP!
    DJJazzyJeff
    • popularity

      "most popular" should never be confused with "best"

      PHP wasn't 'built' it evolved. That said, PHP is a language that people love. I left it out of my list for a very particular reason: it's not, AFAIK, introducing people to features that bring them closer to LISP. You may think that's OK.
      windley