Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Why and how is Lisp better?
11 points by newman314 on April 21, 2010 | hide | past | favorite | 11 comments
Disclaimer: I have not looked much at Lisp previously and in light of the potential ITA Software acquisition, I was curious about why Lisp is liked and for what domains of problems it is useful for. ITA's QPX is held as a common example but in some quick searching, I see no article showing why it was a preferable language to code in as opposed to some other higher-level language.


Excellent question, but did you Google for it? Here's a direct answer:

http://itasoftware.com/careers/l_e_t_lisp.html?catid=8

and on a more general level Marvin Minsky wrote an excellent paper:

http://danreetz.com/ongoing_oversight_and_observation/minsky....

Personally, I prefer to 'prototype' things in Python. And I'm not alone. E.g. Peter Norvig is one of the top Lisperati and he has defected to Python.


Personally, I prefer to 'prototype' things in Python. And I'm not alone. E.g. Peter Norvig is one of the top Lisperati and he has defected to Python.

I think one of the design goals for Arc was to make a Lisp that's maximally attractive for prototyping. Of course, whether or not it has succeeded in achieving this goal is controversial.


I was waiting for a long time for PG to release Arc. Learning languages is easy but become productive with the libraries can take a long time (I come from Java and defected because I just couldn't keep up with all the APIs). So I chose Python before Arc became available and the "batteries included" approach has suited me well. Speaking of which, anyone care to mention how many "batteries" Arc comes with? I believe the Clojure took off as fast as it did because it is built upon the wealth of Java APIs, ditto for IronPython.


There's a web server and application server included, along with sample code for a blog, a web-based prompt and the software behind news.yc. The Anarki repo has a lot of valuable community contributions, like help and source reference from the REPL, interfaces/implementations to other languages including Java, an IDE and modes + syntax highlighting for emacs and vim and a way to escape into PLT Scheme/Racket for access to all that Lisp has to offer. Of course it comes with threading, I/O, math/date/time operations etc.

This is just off the top of my head, I've surely omitted much. If you want to know more:

Arc Forum - http://arclanguage.org/forum

Tutorial - http://ycombinator.com/arc/tut.txt

Install guide - http://arclanguage.org/install

Unofficial documentation - http://files.arcfn.com/foundation-doc.html


Lisp isn't a purely functional programming language, it can have side effects if you want it to but it isn't required.

The best way to see lisp is as a programming language which allows you to quickly build a context specific language to solve the desired problem. It is great for parsing data, prototyping, doing data driven design (since lisp code is data).

It is also one of the more efficient high level language and so is suitable for almost any task. The only reason not to use it is if you don't like parentheses. I recommend you give it a try, it's a lot of fun. Try reading SICP (the wizard book) and using Dr. Scheme for a nice start.

Cheers


I've been curious about the practical applications of LISP as well. Pure functional programming, as I understand it, means no side effects. The issue with this is that procedural & OO programming lives off of side effects: screen displays, file writes, etc. How would you build a GUI application in something that shouldn't give you anything but an answer? I'm aware that it is done, of course (web servers, games, etc), but how you would do something like that escapes me.


You're absolutely right that many practical applications require side effects. What happens in Lisp is that the programmer tries to write as much purely functional code as possible and only resort to side effects when completely necessary. This approach greatly aids in code debugging and maintenance.


I did see http://www.lispworks.com/products/myths_and_legends.html but would like to see HN's input on where Lisp would be useful in today's web world of <insert web20 catchphrase> of tools.

PS: I know asking a question like this may cause some emotional responses but I am genuinely interested in use cases for Lisp. Thanks in advance.


Exploratory programming, where you have an idea but are not sure how to get there, is an area where lisps arguably outshine everything else. Thanks to macros you can shape the way your code looks to fit the domain you are working in to pretty extensive degrees.

When you throw in the power something like Clojure gives you, with lisp style syntax and macros but access to all the libraries on the JVM (including Jetty/Hadoop/etc) you can accomplish a lot.


One aspect of lisp that I love the most is the "map" function. Arguably, many languages have it now and the infamous Google's map/reduce was inspired by this :-)

Also, Lisp has been used in many A.I applications, natural language processing, and of course, I believe this little company called Viaweb (founded by one of the HN users, pg, I think ;-) used lisp to their competitive advantage.


Yes, PG himself (HN BDFL?). If you check out his articles you'll find an interesting bit of history on it. The biggest joke is that after ViaWeb was acquired the suits decided that "it had to be " re-written in C++.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: