Slashdot Mirror


Practical Common Lisp

Frank Buss writes "Common Lisp is an ANSI standard, which defines a general purpose language and library, and is implemented by free and commercial compilers and IDEs; see *hyper-cliki* for more general information about Common Lisp. The book Practical Common Lisp explains the language with many practical examples and is available in full text online, too." Read on for the rest of Buss' review. Practical Common Lisp author Peter Seibel, Gary Cornell (Editor) pages 500 publisher Apress rating 8 reviewer Frank Buss ISBN 1590592395 summary A book for learning and using Common Lisp

Unlike other good books about Lisp, which are focused on a specific domain, like AI (such as Paradigms of Artificial Intelligence Programming ) or basic computer science (for example Structure and Interpretation of Computer Programs for the Lisp-like language Scheme), this book focuses on solving real-world problems in Common Lisp, like web programming, testing etc., after introducing the language by examples in the first chapters. I started with Lisp half an year ago, and it has helped me a lot in learning it. But even if you already know Lisp, this book may be useful for you, because it has a fresh view on the language and the examples in the later chapters are usable in your day-to-day work as a programmer.

The first chapter tells you something about the author (he was a good Java programmer before starting with Lisp) and the history of Lisp and Lisp dialects like Scheme. The next chapters are a tour through all Lisp features, written in easy-to-understand steps, beginning with the installation of a Lisp system and an introduction to the interactive REPL. You don't need any experience in other languages to understand it.

The general concept throughout is to explain a feature first, then show an example of how to use it, with detailed discussion of what the example does and possible pitfalls. A nice example is the APPEND function, which does not copy the last argument:

The reason most list functions are written functionally is it allows them to return results that share cons cells with their arguments. To take a concrete example, the function APPEND takes any number of list arguments and returns a new list containing the elements of all its arguments. For instance:(append (list 1 2) (list 3 4)) ==> (1 2 3 4)

From a functional point of view, APPEND's job is to return the list (1 2 3 4) without modifying any of the cons cells in the lists (1 2) and (3 4). One obvious way to achieve that goal is to create a completely new list consisting of four new cons cells. However, that's more work than is necessary. Instead, APPEND actually makes only two new cons cells to hold the values 1 and 2, linking them together and pointing the CDR of the second cons cell at the head of the last argument, the list (3 4). It then returns the cons cell containing the 1. None of the original cons cells has been modified, and the result is indeed the list (1 2 3 4). The only wrinkle is that the list returned by APPEND shares some cons cells with the list (3 4). The resulting structure looks like this:

In general, APPEND must copy all but its last argument, but it can always return a result that shares structure with the last argument.

In chapter 9, the first larger practical example is developed, a unit testing framework (like JUnit), which is easy to use and to enhance.

Certain Lisp implementation behaviors can be confusing, such as those for for building pathnames. The pathname concept in Lisp is very abstract, leading to different choices in different implementations. This is no problem if you use only one implementation, but chapter 15 develops a portable pathname library, which works on many implementations. By doing this, it shows you how to write portable Lisp code, using different code for different implementations with reader macros.

After an introduction to the Common Lisp Object System (CLOS) and a few practical FORMAT recipes (the printf for Lisp, but more powerful), chapter 19, "Beyond Exception Handling: Conditions and Restarts", is really useful. The exception handling in Lisp (called "condition system") is more general than other exeption systems: In Lisp you can define restarts where you generate an exception and the exeption handler can call these restarts to continue the program. After reading this chapter, you'll never again want to use the restricted version of Java or C++ exception handling.

Chapters 23 to 31 show real world examples: a spam filter, parsing binary files, an ID3 parser, Web programming with AllegroServe, an MP3 database, a Shoutcast server, an MP3 browser and an HTML generation library with interpreter and compiler. If you ever thought that Lisp is an old language, only used for AI research, these chapters prove you wrong: Especially the binary files parser shows you, how you can extend the language with macros for implementing binary file readers, which looks nearly as clear and compact as the plain text binary file description itself. I'm using some of the ideas for a Macromedia Flash SWF file reader/writer I'm currently writing. Take a look at my Web page for my currently published Lisp projects.

The Web programming chapters demonstrates how to use a dynamic approach for generating web pages. You just start a Web server in your Lisp environment; then you can publish static Web pages or define functions, which are called when the page is requested by a browser. The author demonstrates how to define dynamic pages with formulars in Lisp and Lisp HTML generators.

After reading Practical Common Lisp, you will know most of Common Lisp and how to write real-world programs with it. Some special features, like set-dispatch-macro-character, or using one of the non-standard GUI libraries, are not explained, but it is easy to learn the rest of Common Lisp and to use other Lisp libraries, with the knowledge gained from this book.

You can purchase Practical Common Lisp from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page

617 comments

  1. I'm sorry, by re-Verse · · Score: 3, Funny

    But since we're practicing it, Isn't that supposed to be lithp

    1. Re:I'm sorry, by b17bmbr · · Score: 3, Funny

      thtop. that'th a thtupid potht. you thould be athamed.

      --
      My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
    2. Re:I'm sorry, by hey! · · Score: 1

      Gee, I never heard thatone.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    3. Re:I'm sorry, by fallendove · · Score: 0

      Whatth your problem? Are you humorleth?

    4. Re:I'm sorry, by Anonymous Coward · · Score: 0

      No, itth my hairlithp.

  2. My first exposure to list ( and a mirror of book ) by winkydink · · Score: 3, Informative

    Whenever I think of Lisp, I'm transported back in time to 1975 where I'm trying (unsuccessfully) to learn this as my 2nd programming language after Fortran IV (on a DECsystem-10, no less).

    I never revisited Lisp. Perhaps now that I have the book, I'll give it a shot.

    You can download a copy here if the main site is too busy.
    ~

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

  3. LISP is amazing. by millennial · · Score: 5, Interesting

    I took a Programming Languages course up at Michigan Tech a couple years back. We wrote our own interpreter using nothing but Common LISP, and it blew my mind. It got me really interested in programming language design.
    However, LISP can also be hard to learn. The function names don't make sense to most people who have been raised on higher-level (1980s+) languages. I mean, 'car' to grab the first element of a list, and 'cdr' to grab all the others? It can get downright confusing sometimes.

    --
    I am scientifically inaccurate.
    1. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      `First' and `rest' work just as well nowadays...

    2. Re:LISP is amazing. by millennial · · Score: 2, Funny

      Oddly enough, they only taught us the nonsense word names. Well, I suppose 'car' isn't a nonsense word... but in this context it's damn close.

      --
      I am scientifically inaccurate.
    3. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      > I mean, 'car' to grab the first element of a list, and 'cdr' to grab all the others? It can get downright confusing sometimes.

      Lisp is archaic. What can it do practically, that Python can't?

    4. Re:LISP is amazing. by worst_name_ever · · Score: 4, Funny
      I mean, 'car' to grab the first element of a list, and 'cdr' to grab all the others? It can get downright confusing sometimes.

      But it leads to hilarious bumper stickers, such as: "My other car is a cdr"

      --

      In Soviet Rush, today's Tom Sawyer gets high on you.
    5. Re:LISP is amazing. by UWC · · Score: 1
      But can you do 'caddr' and such using 'first' and 'rest'?

      I used LISP in an AI class. Seemed very interesting, and definitely useful for some applications. I almost wish I had done more with it. Almost. And yeah, I didn't learn about 'first' and 'rest' in that class, either.

    6. Re:LISP is amazing. by Homonymous+Howard · · Score: 3, Informative
      The function names don't make sense to most people who have been raised on higher-level (1980s+) languages. I mean, 'car' to grab the first element of a list, and 'cdr' to grab all the others? It can get downright confusing sometimes.
      Common Lisp has first and rest as accessors for lists. Many Lispers consider it good style to use them when treating conses as lists and to use car/cdr when treating conses as binary trees.
    7. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      Don't forget other golden oldies like "progn" and "setf".

    8. Re:LISP is amazing. by stinerman · · Score: 2, Funny
      That doesn't make much sense. I prefer a recent .sig I saw:

      My other car is first.
    9. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      Didn't some lisp zealot ever explain why they personally *like* car and cdr? Usually they go on and on about how its composable, like that's and advantage. "cadadar" anyone? Oh, and don't forget, you can pronounce "cdr" (just like you can pronounce "thxbltj").

    10. Re:LISP is amazing. by haystor · · Score: 2, Informative

      If you are a python programmer, there is nothing LISP can do that python can't.

      Full blown macros are still beyond the reach of python I believe. I use these all the time and any language without LISP macros feels like I'm back in high school doing endless exercises over things I already know. Other languages talk about patterns and abstraction but their idea of this pales next to what can be done in LISP.

      I'd elaborate but people attached to their own languages won't believe.

      --
      t
    11. Re:LISP is amazing. by nizo · · Score: 1, Funny

      Which leads us to the LISP catch phrase: "Easier to use than assembler".

    12. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      They're both Turing complete, so use the best tool for the job. If more than one tool is perfectly suitable, use the one you like best.

      Of course, Python isn't even a real language compared to Lisp. Python has spent most of its life trying to drag features one at a time out of Lisp to become usable, only to now start trying to throw those features away to become unLisp-like. A Python parser is several orders of magnitude harder to write than a Lisp parser, and you can't write a Python program without having to deal with terrible whitespace/syntax issues. Lisp is even closer to the hardware than Python is, but it can still support higher level language programming than Python.

      Use Python when you aren't smart enough to use anything else. Use C, Forth, Ada, Fortran, assembly, Ruby, Perl, Lisp, or Brainfuck every other time.

    13. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      > If you are a python programmer, there is nothing LISP can do that python can't.

      Most Common Lisp implementations compile to native code and are an order of magnitude faster than Python.

    14. Re:LISP is amazing. by Maskull · · Score: 1

      So use 'first' instead of 'car' and 'rest' instead of 'cdr'. Of course, this messes with the jokes.

    15. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      toy language of no commercial value

    16. Re:LISP is amazing. by myowntrueself · · Score: 1

      "I mean, 'car' to grab the first element of a list, and 'cdr' to grab all the others? It can get downright confusing sometimes."

      I completely agree.

      LISP implementors still insist on the use of the acronyms 'contents of address register' and 'contents of decrement register' when these are now completely irrelevent and redundant and have been for what? Decades? Is there still a LISP implementation in production use that uses address and decrement registers in this way?

      'head' and 'tail' will do just nicely and be less confusing.

      The language is 'living in the past', so to speak.

      (By the way, 'LISP' stands for 'Lots of Insidious, Spurious Parentheses' but thats a whole nother troll).

      --
      In the free world the media isn't government run; the government is media run.
    17. Re:LISP is amazing. by Anthracene · · Score: 2, Insightful

      Or the sig of a CS prof at my undergrad school:

      Today is the car of the cdr of your life.

    18. Re:LISP is amazing. by millennial · · Score: 1

      Try "coulder". and thixbulltjay.

      --
      I am scientifically inaccurate.
    19. Re:LISP is amazing. by Da+VinMan · · Score: 1

      I'd elaborate but people attached to their own languages won't believe.

      Please do elaborate. Anyone I know who loves LISP (especiall the macros) has seen it as the "one true way", but I've never had anyone be able to explain the magic to me. Heck, I did some LISP programming for a graduate AI course I did a few years ago, and I still didn't see the magic.

      So, if you could finally clear this up for me, I'd appreciate it.

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    20. Re:LISP is amazing. by ShadowFlyP · · Score: 1

      You've got to remember how old Louther is. He probably hasn't been following any updates to the language since 1972.

    21. Re:LISP is amazing. by dragondestroyer · · Score: 2, Informative

      There are FIRST ... TENTH and REST. See http://www-2.cs.cmu.edu/Groups/AI/html/cltl/clm/no de149.html

    22. Re:LISP is amazing. by sketerpot · · Score: 1
      The advantage of car and cdr is that you can compose them into things like cdadr. Not that you should, except when you're in a hurry.

      If you don't want to use car and cdr, use first and rest. You have a choice.

    23. Re:LISP is amazing. by sketerpot · · Score: 3, Informative
      It's much easier to use than assembly. In assembly language, for example, it would be non-trivial to do something like this:

      (remove-if-not #'oddp list-of-numbers)

      That returns a list of all odd numbers in a list of numbers. With this sort of a difference in ease of use, why are you comparing Lisp to assembly language? My guess is that you're just talking out your ass.

    24. Re:LISP is amazing. by cpeterso · · Score: 1


      use car/cdr when treating conses as binary trees.

      If you are walking a binary tree, why not use function names like left and right, instead of car and cdr?

    25. Re:LISP is amazing. by Tayssir+John+Gabbour · · Score: 1
      Please do elaborate. Anyone I know who loves LISP (especiall the macros) has seen it as the "one true way", but I've never had anyone be able to explain the magic to me. Heck, I did some LISP programming for a graduate AI course I did a few years ago, and I still didn't see the magic.

      So, if you could finally clear this up for me, I'd appreciate it.

      I agree the "one true way" thing is a bit disturbing. I think of Lisp as a Borglike language which can assimilate other paradigms. And has a robust set of built-in primitives, so you get things like unusually featureful arrays and rational numbers like 5/3.

      Ideally, the modern Lisper should be equipped to thoughtfully judge other languages. Like MacGyver. MacGyver-oriented programming. ;)

    26. Re:LISP is amazing. by sketerpot · · Score: 2, Interesting
      Well, try looking at the PCL chapter on making an HTML-generation library that lets you intersperse Lisp code with a weird parenthesesified version of HTML. Here's an example of the code you can write with it:

      (html (:ul (dolist (item stuff)) (html (:li item))))

      (Sorry I had to put that on one line, but Slashdot doesn't handle code indentation very well.)

      This HTML generation stuff is very useful, and it's pretty difficult to make without using macros. Also, this compiles down to efficient code, rather than being interpreted.

      There are other examples. For example, the LOOP uber-macro doesn't require any special support from the Lisp implementation, but it's practically a mini-language for expressing common looping idioms.

    27. Re:LISP is amazing. by wrf3 · · Score: 1

      For an excellent counterexample, see Beating the Averages by Paul Graham.

    28. Re:LISP is amazing. by myowntrueself · · Score: 0, Flamebait

      "The advantage of car and cdr is that you can compose them into things like cdadr. Not that you should, except when you're in a hurry."

      Thats a *disadvantage* as it is encouraging, er, 'wooly thinking'

      What does 'contents of decrement address decrement register' mean? Nothing, thats what it means. It doesn't even refer to the way that the old LISP machine hardware worked.

      Its a false mnemonic.

      Besides which, just look at modern functional languages; its obvious that the excessive parenthisation in LISP is totally uneccesary.

      They just couldn't write a parser for shit so they took the old adage "If in doubt, bracket" far too seriously and made it compulsory.

      Ok theres also driving the 'everything-as-list' metaphor to absurdity, much as smalltalk did for object orientedness and prolog for logicness.

      These were all experimental languages developed at a time when people were learning how to define, design and implement programming languages. This includes C and LISP.

      We've learned a lot.

      Its time to move on.

      --
      In the free world the media isn't government run; the government is media run.
    29. Re:LISP is amazing. by sketerpot · · Score: 2, Insightful
      Thats a *disadvantage* as it is encouraging, er, 'wooly thinking'

      It can be handy during debugging. I don't recommend using cdaadr (et al) in production code.

      They just couldn't write a parser for shit so they took the old adage "If in doubt, bracket" far too seriously and made it compulsory.

      Wrong. Lisp has parentheses in specific places, leaving no doubt about where you're supposed to put them. Adding excessive parentheses to Lisp code changes it.

      And the parens and the code-data equivalence do have a purpose. They make working with the code programmatically very easy, which allows Lisp macros. The macros that every Lisp fan always mentions. They wouldn't be nearly as useful if Lisp didn't use the parentheses. And the parens are amazingly easy to edit with proper editor support.

    30. Re:LISP is amazing. by Osty · · Score: 1

      thixbulltjay

      I'm partial to "thixbulltage" for thxbltj.

    31. Re:LISP is amazing. by haystor · · Score: 5, Informative

      Ok, first imagine what it would take to add something to a language like Java. Let's take try/catch/finally as an example. You might have some java code that works like:

      try {
      methodCall();
      } catch (Exception e){ //TODO: we'll clean this up later
      } finally {
      otherMethodCall();
      }

      Now let's say I wanted something like try/catch only specifically geared toward database transactions. I want it to look like this:

      tran { //db operations go here
      } rollback { // code handling rollback
      } success { // code specific to a successful transaction
      }

      You just can't do that. Sure you could get similar functionality through the use of try/catch and a bunch of helper functions, but you can't integrate it straight into the language itself. You can only add to the language's library. In LISP, there is no real difference.

      I can implement a "tran" macro so I can do things like:

      (tran (withdraw 25.00 from-account)
      (deposit 25.00 to-account) :rollback #'rollback))

      This particular instance is my favorite example. It may not seem like a big deal, but I have hundreds of these things that aren't a big deal in my code. If I think something can be done a better way in the language I can add it.

      The tran macro would be expanded during runtime to something that looks more like:

      (begin-tran)
      (withdraw...)
      (deposit...)
      (end- tran) or (rollback) depending on what happened.

      A more complicated version of this macro could take into account nested versions of itself.

      Someone will say that try/catch can be made to accomplish what I want. Yes it can. Those same people won't admit however that Perl can be bent to do what Java does.

      There is a lot of writing about how great it is to have macro expansion at runtime. That was always meaningless to me until I latched on to that "tran" example above. All of a sudden I realized I wasn't bound to passing values (or references to values, essentially the same thing) to a function. Now I could pass whole chunks of code around. This struck me as such a right thing to do. I'd always been bugged that all the Java consultants around me were memorizing patterns. If something is a pattern, shouldn't the computer be doing it? LISP told me that yes, the computer should be doing it, not that I should be writing pages of patterned code.

      It took me a year of talking to one of the guys I worked with where I explained macros to him. Six months after I left that place we went to lunch and he told me he finally saw the light as he was cutting and pasting some in one of his J2EE programs.

      If you've ever been looking at something in the language (not the library) and wished that it worked just like that, only different, that is one case where you use a macro.

      --
      t
    32. Re:LISP is amazing. by turbidostato · · Score: 1

      Why "coulder" instead of "cider"?

    33. Re:LISP is amazing. by Lawrence_Bird · · Score: 1

      I've read a few articles over the years on lisp but really
      have done nothing with it, but my first impression on seeing
      car and cdr as you have defined is 'character read and card
      read'. God bless my FORTRAN COBOL upbringing for that :)

    34. Re:LISP is amazing. by e40 · · Score: 2, Informative

      OK, then do it. (defmacro left (x) `(car ,x)) and (defmacro right (x) `(cdr ,x)).

    35. Re:LISP is amazing. by rsheridan6 · · Score: 1
      It's extensible in a way that Python isn't. If you want, say, eager comprehensions, or the keyword 'yield', with Lisp you write a macro. In Python (or almost any other language) you wait for the BDFL, with his God-like power, to put it into the language.

      As a consequence of this, you can write some really idiosyncratic Lisp code, in contrast to Python which encourages one coding style. Different strengths for different groups.

      --
      Don't drop the soap, Tommy!
    36. Re:LISP is amazing. by rsheridan6 · · Score: 1
      "setf" stands for "set field," and "progn" makes sense when considered along with "prog1" and "prog2" - they respectively return the value of their nth, 1st, and 2nd argument.

      These are sort of cryptic names, but at least they have some relation to what they actually do, as opposed to "car" and "cdr".

      --
      Don't drop the soap, Tommy!
    37. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      Actually, Scheme has both more general and more practical macros (SYNTAX-CASE).

    38. Re:LISP is amazing. by anactofgod · · Score: 5, Insightful

      I love it when people comment on Lisp without learning even most rudimentary aspects of the language. Not to single you out, but it is obvious to when one reads a comment posted by someone who is regurgitating commentary provided elsewhere by other who know nothing about the subject.

      I'm not certain what you've learned, but it certainly isn't "a lot". Certainly not about programming language design in general, and Lisp in particular. If you had even taken the time to read about just the history and design of Lisp, which is accessible to even the layman, you'd be able to post a more insightful comment than you just did. Why don't you try that, at minimum, since you are obviously uninterested and/or incapable of learning the technical apsects of the language.

      As for Lisp being an experimental language, nothing could be farther than the truth. Lisp is a language that was several decades ahead of its time in design, functionality and capability. Everything else is just now catching up. Evidence all the effort to fold in Lispy features into Python, Perl, Ruby, etc., etc. The thing is, these languages' designers are trying to bolt the features into their language after the fact. While Lisp Just Works.

      So, since you raised the topic, what's the answer? What would you have us "move on" to?

      --

      ---anactofgod---

      "Equal opportunity swindling - *that* is the true test of a sustainable democracy."
    39. Re:LISP is amazing. by UserGoogol · · Score: 1

      Off hand, I imagine it makes it easier to prounounce cdadr when the "c" in both car and cdr are prounounced the same, and to my ear it just sounds better.

      --
      "Never attribute to malice that which can be adequately explained by stupidity." -- Hanlon's Razor
    40. Re:LISP is amazing. by budgenator · · Score: 1

      The way I understand it is CAR and CDR refer to registers on an IMB 360, the CAR register contained the pointer to the first part of the list and the CDR register the pointer to the rest of the list, it makes sense to people used to programming in IBM 360 asembly language.

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    41. Re:LISP is amazing. by thisgooroo · · Score: 3, Insightful
      What does 'contents of decrement address decrement register' mean? Nothing, thats what it means. It doesn't even refer to the way that the old LISP machine hardware worked. Its a false mnemonic.

      the mnemonics describe the implementation of cons cells (the basic elements from which lists are constructed, but which also can be used for other purposes). they actually are the IBM 704 assembler instructions to access the componenets of cons cells. Most (all?) lisp implementations provide other mnemonics tailored for the particular datastructures, but Lisp has a tradition of backwards compatibility, so the car and cdr mnmonics were kept in

      Besides which, just look at modern functional languages; its obvious that the excessive parenthisation in LISP is totally uneccesary.

      the original spec of lisp (the lisp1.5 manual) used both the current syntax and a more algol like syntax, but the first implementation was done in the parenthesized syntax. as one of the texts on the history of lisp explains, the suitability of the s-expression syntax for mcro processing was discovered quite early and convinced practically all lisp users not to bother with a more traditional surface syntax, even though there were a few attempts (one of the first i remember was something called Lisp2 done at Stanford in the early to mid 1960s. it looke very much like algol.

      They just couldn't write a parser for shit so they took the old adage "If in doubt, bracket" far too seriously and made it compulsory.

      bull.

    42. Re:LISP is amazing. by millennial · · Score: 1

      Because the 'o' sound is more natural to English speakers. Cdr sounds more natural as 'coulder' than 'cider', because the 'o' sound is produced as a natural progression from a hard 'c'. The 'i' has to be inserted arbitrarily.

      --
      I am scientifically inaccurate.
    43. Re:LISP is amazing. by Pxtl · · Score: 1

      This, imho, is something every language should have, and yet the only new language I've seen that lets users create their own blocks that way is Ruby, and nobody uses Ruby, 'cause it feels like somebody took Python and took all the ease-of-use out. I just want Python with custom blocks.

      The thing to compare is not just the language, but the implementations. For example, the Java compiler and runtimes are free, cross-platform, and have obscenely robust libraries bundled in (for everything except GUI, where the built-ins are retarded). Python is opensource and pretty much lets you get at every single aspect of a standard Linux box, plus is cross-platform with Win32 - even with the GUI objects through TkInter.

      What does Lisp have?

    44. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      What does Lisp have?

      None of the above, and this is Lisp's downfall and why it's not practical for most purposes today.

      There are free Lisp compilers on all platforms, but there aren't cross-platform, cross-compiler libraries for sockets or threads or GUI interfaces or graphics, for instance. And there's no easy way to create any of these - each compiler has its own way to interface with C that's not compatible with the others. And IIRC, there isn't a single free Lisp implementation that runs on all 3 of OS X, Linux, and Windows. I evaluated Lisp a few months ago for my current project... I like the language, but for a cross platform, graphical network game there were just WAY too many peripheral issues to be worked out, so I rejected it.

      I'm now using C++ and Lua. Neither of these is absolutely ideal, but they certainly work and there's plenty of libraries to do everything I want.

    45. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      That's an interesting scheme.

    46. Re:LISP is amazing. by CableModemSniper · · Score: 1
      list_of_numbers.delete_if { |x| x % 2 == 0 }

      I dunno what point I'm trying to make here.

      --
      Why not fork?
    47. Re:LISP is amazing. by stesch · · Score: 2, Informative

      See What's with All the Parentheses? and the conclusion In other words, the people who have actually used Lisp over the past 45 years have liked the syntax and have found that it makes the language more powerful.

    48. Re:LISP is amazing. by Pxtl · · Score: 1

      Well, I understand there's a .NET Lisp in the works, which would mean cross-platform and featureful (thanks to MS-CLR and Mono) Lisp. Anybody have details?

    49. Re:LISP is amazing. by afroborg · · Score: 1

      Hmmm... I prefer "Kidder"..

      --
      my sig could kick your sig's arse...
    50. Re:LISP is amazing. by say · · Score: 1

      And just how do you suppose you should access for instance the cdr of the car of the cdr of a list? (cdr (car (cdr x)))? Why is that easier to read than (cdadr x)?

      --
      Roses are #FF0000, violets are #0000FF, all my base are belong to you
    51. Re:LISP is amazing. by Anonymous Coward · · Score: 0
      List.filter (fun x -> x mod 2 = 0)
      Me neither. Funny how many modern languages can do all the stuff Lisp does, only better, isn't it?
    52. Re:LISP is amazing. by Anonymous Coward · · Score: 0
      And just how do you suppose you should access for instance the cdr of the car of the cdr of a list? (cdr (car (cdr x)))? Why is that easier to read than (cdadr x)?

      You shouldn't be doing that at all, since it will cause a runtime error if the list is not the shape you're expecting.

      You should be using a modern language like ML, which can express this in a safe way, that also visually shows the structure of the list you're accessing instead of expecting a programmer to figure it out by decyphering your cryptic functions:
      match x with
      _ :: (_ :: y) :: _ -> y
      | _ -> panic ()
      Here we can see quite plainly that you're asking for the tail of the second cell of the list, if it has one; if it doesn't, the function panic is called instead.

      Of course, it looks like you're not dealing with a list at all, but rather a tree of some sort. ML lets you use actual binary trees for that, instead of faking them unreliably with lists.
    53. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      Everything else is just now catching up. Evidence all the effort to fold in Lispy features into Python, Perl, Ruby, etc., etc. The thing is, these languages' designers are trying to bolt the features into their language after the fact. While Lisp Just Works.

      Why do Lisp zealots always cite the usual broken languages? Are you blind to the existence of real modern well-designed languages like Haskell and ML? Or are you quite aware that they exist, and merely afraid to acknowledge them because it weakens your case?

      So, since you raised the topic, what's the answer? What would you have us "move on" to?

      Haskell. All the power of Lisp, all the elegance of Python or Ruby, plus the safety and advanced design that a further fifty years of academic language research bring.

      Any other questions?

    54. Re:LISP is amazing. by turbidostato · · Score: 1

      Quite offtopic but...

      Well, I am not English native, and a soon as I saw "cdr", first thing that came to my mind was "Cider... Strongbow cider, yumm..." (ala Homer Simpson).

      It's curious to know other people will see differently when "cider" became so patently obvious to me.

    55. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      I've always pronounced "cdr" as "k'DIR" (kind of like "kuh-DIR", but with the "uh" part severely truncated).

    56. Re:LISP is amazing. by IkeTo · · Score: 1

      Any language that supports closures fully can support that. Perl can, Javascript can, and Python can. Perl even have syntactic sugar (in particular, subroutine prototype) which makes it easier to define your own syntax (see how Error.pm does that). None of them are as fast as a compiled Lisp program, and none of them are as flexible (since you don't need to treat the closure as a black box in Lisp, whereas in Perl you can't see what is in the closure argument), though. On the other hand, if you see people who says "Java is a very developer-friendly language that allows you to code very rapidly", they are seriously mistaken.

    57. Re:LISP is amazing. by millennial · · Score: 1

      It all comes down to the difference between seeing groups of letters as words or sounds. "Cider" would be a natural choice for a word (just fill in the letters), but "coulder" seems more natural for a sound (at least for me).

      --
      I am scientifically inaccurate.
    58. Re:LISP is amazing. by master_p · · Score: 1

      All the above is possible due to the S-Expression syntax. I can wrap up the above example in a C macro, but does that make C any better? nope.

      The only good thing of LISP is that: the S-Expression syntax, that allows for any custom language to be implemented inside the primary language. Other than that, it has a lot of nasties.

      LISP would have dominated if it was only one step above assembler, like C, but with S-Expressions. In fact, that's what many have been asking for a lot of time: the power of C (mess with pointers, direct memory access etc) and the syntactic power of LISP. The macro facility of LISP allows for introducing garbage collection, classes, multiple inheritance, properties, reflection and all other goodies on top of a basic close-to-the-hardware language.

    59. Re:LISP is amazing. by releppes · · Score: 1

      This caught me off guard too. When I learned Common Lisp, I remember using head/tail and not car/cdr. It wasn't until I started playing with LispMe (a Scheme interpreter for the Palm) that I was introduced to the car/cdr notation. I always thought the car/cdr notation was horrible just because the names were too similar. Even visually, it's easy to screw up the middle 'a' and 'd'.

      It's been my only hangup with Scheme. I always felt the function names were too cryptic. Even the 'lambda' function. Couldn't they have called it 'template' or sometime more self describing? In any case, I do love the language although I suck at imperitive programming.

      By the way, I know the easy answer to my complaint is to rename all the standard functions to something more meaningful. Just more hassle than it's worth I suppose.

    60. Re:LISP is amazing. by Pxtl · · Score: 1

      Well, although many languages have lexical closures, very few allow custom blocks, which is simply syntactic sugar on top of lexical closures. Very few languages let you make a custom looping block system and have it work as well as the built-in loop statements. afaik, only Ruby and lisp-alikes let you, neither of which could be considered mainstream.

    61. Re:LISP is amazing. by Theatetus · · Score: 1
      Thats a *disadvantage* as it is encouraging, er, 'wooly thinking'

      No, having car and cdr in addition to first and rest encourages making a semantic distinction between using cons cells as cons cells and using them as lists. Just like having both nil and () encourages making a semantic distinction between an empty list and a false atom.

      Besides which, just look at modern functional languages; its obvious that the excessive parenthisation in LISP is totally uneccesary.

      OK, this one I really don't understand: here's some lisp code:

      (function-1 arg1
      (function-2 arg2 arg3)
      (function-4))
      And here's the equivalent in C:
      function_1(arg1, function_2(arg2, arg3) function_4());

      Hmmm... the C example has just as many parentheses as the lisp example. Oh, and it has to have commas too. Maybe "C" stands for "comma-dependent" or something.

      I do have a theory of where the thing about "too many parentheses" comes from:

      1. There are slightly more parentheses because a few lisp primitives are infix operators in other languages
      2. lisp encourages a functional programming style, so most work is done by function calls rather than extended blocks of code
      3. lisp programs are generally much shorter in terms of LOC than the equivalent program in another language. But, since roughly the same amount of work is being done, roughly the same number of functions are being called. So, while both a lisp and Java program might have 500 parenthesis pairs, the Java program spreads them out over 1000 lines while the lisp program puts them in 400 lines.
      --
      All's true that is mistrusted
    62. Re:LISP is amazing. by Intron · · Score: 1

      Naughty Dog does their 3D modelling in CL. I don't think there's any lisp in the runtime environment, tho. Lua looks like a really an interesting language. I think I'll take a closer look at it.

      --
      Intron: the portion of DNA which expresses nothing useful.
    63. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      This, imho, is something every language should have, and yet the only new language I've seen that lets users create their own blocks that way is Ruby...

      You're confusing codeblocks (more specifically, closures) with macros. They're very different. Closures exist in many languages, including Lisp, Scheme, Haskell, ML, Smalltalk, Perl, Ruby, and even Javascript. They are one of the foundations of the functional programming paradigm, and do allow for a good amount of abstraction and code reuse, but they don't allow you to extend the language the way that Lisp macros can. See chapter 7 of Practical Common Lisp for an intro to macros which shows how much of Lisp itself is implemented as macros.
    64. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      What can it do practically, that Python can't?

      Funny you should ask. There's this book called Practical Common Lisp... perhaps you've heard of it?

    65. Re:LISP is amazing. by lanfor · · Score: 1
      If you are a Turing Machne programmer then other languages offer you nothing that a Turing Machine doesn't.

      Come on - it doesn't matter *what* I can do in a given language. Most languages (even functional ones) are equivalent to a Turing Machine (okay so one can argue about execution times, but the question was *what* is possible to program).

      What I think matters is how easy it is to program something in haskell, lisp, python, c, etc.

      --
      Lukasz Anforowicz
      Hikipedia - a free database of hi
    66. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      As already pointed out elsewhere in these threads, most people bashing (Common) Lisp have no idea of the language status.

      While the ANSI standard correctly includes CAR, CDR, CADAR, CDDDR etc etc for historical and practical reasons, it also includes FIRST and REST (and SECOND, THIRD, up to TENTH)

      So, before posting other comments like the above, you are kindly required to learn by hearth the ANSI standard (which can be found at www.alu.org) plus the definition of all the libraries that the 4 commercial implementations plus the 5 "free" ones provide.

      What would you end up saying otherwise? Maybe that Common Lisp is an interpreted language? :)

      Thank you -- marcoxa

    67. Re:LISP is amazing. by sketerpot · · Score: 1

      The bigger issue here is that, if you're seriously using cdadr (and similar functions) often, you probably need to rethink your data structures or the method you're using to manipulate them.

    68. Re:LISP is amazing. by sketerpot · · Score: 1

      I don't know either. It looks like a straight translation from Lisp to whatever language you wrote it in (Ruby?), except without a built-in oddp function. And I wrote that snippet of Lisp code to rebut the comparison of Lisp's ease of use with that of assembly language, so I'd say that what you've proven is that another language is also easier to use than assembly.

    69. Re:LISP is amazing. by Anonymous Coward · · Score: 0

      That's actually a stronger statement than the English version.

      Since (equal (car (cdr life)) (car life)) but (not (eq (car (cdr life)) (car life))), not only is "Today the first day of the rest of your life," but also it's the "Same shit, different day." :)

    70. Re:LISP is amazing. by Chris_Jefferson · · Score: 1

      You have just described LISP's biggest strength, and biggest weakness.

      LISP's power is that you can completely re-invent the language in whatever way you like.

      LISP's biggest problem, and the reason that while I love it I will never use it for a big project, it because you can reinvent the language, and almost every LISP program and library does to some extent.. therefore each large LISP program you try to learn involves basically learning a new language.

      Java's biggest strength is that while it is annoying verbose and limited, it's probably one of the hardest languages to make non-understandable (not saying it's not possible of course, particularily if you make big and nasty enough object heirachies..)

      --
      Combination - fun iPhone puzzling
    71. Re:LISP is amazing. by OOGG_THE_CAVEMAN · · Score: 1

      OOGG respectfully suggest you miss point. Lisp macro allow program be written on very high-level. Language without Lisp macro generally force program be written at low level, or very brittle architecture.

      Some learning necessary to understand *any* code. Once learn Lisp macro library, have much power at one's disposal. Once learn nasty Java object heirarchy, brain hurt, and still must program within brittle heirarchy, with limited Java single inheritance. And, Java architecture usually solve much simpler, more limited problem.

    72. Re:LISP is amazing. by Anonymous Coward · · Score: 0
      Everything else is just now catching up.
      What makes you think so? Everything else didn't recognise that it needed to catch up until now, when it's almost caught up (according to you). But what makes you think there isn't more stuff that everything else still doesn't recognise the need to catch up to?

      My bet is that people will still be saying "everything else is just now catching up" in another 40 years. And they'll still be wrong.

    73. Re:LISP is amazing. by millennial · · Score: 1

      O_O... You know about John Lowther... who are you??

      --
      I am scientifically inaccurate.
    74. Re:LISP is amazing. by ShadowFlyP · · Score: 1

      Just a fellow Tech alum. I graduated last May.

    75. Re:LISP is amazing. by say · · Score: 1

      Well, my programs are seldom accessed by external forces during execution, and my lists are more often than not generated by myself. So I usually have quite large confidence in my lists.

      While I don't find your code example very "plain", I find it amusing that you assume some programmer has to "decypher my cryptic functions". In all reasonable Scheme programs, I would make accessors for my lists (or trees, or tables, or whatever), and then use them. That serves as an explanation as well:

      (define get-node-value cdadr)

      See? Not so hard.

      --
      Roses are #FF0000, violets are #0000FF, all my base are belong to you
    76. Re:LISP is amazing. by Dr.+Photo · · Score: 1

      The tran macro would be expanded during runtime ...

      Macroexpansion happens at compile-time unless you're running interpreted.

      In other words, it's even better than you describe.

    77. Re:LISP is amazing. by turbidostato · · Score: 1

      "but "coulder" seems more natural for a sound (at least for me)."

      Well, but that's what seemed *specially* curious. As you say, to get cider from cdr I just only need to fill in the blanks, but I think there migth be a dozen different words I can get that way. The thing is that if you just try to spell c-d-r what comes is already almost see-dee-ar => cider.

  4. This is not a troll, but a query... by Stanistani · · Score: 4, Interesting

    Could someone proficient in LISP give me three cogent reasons to learn the language?

    1. Re:This is not a troll, but a query... by tenordave · · Score: 5, Insightful

      1) macros will blow your mind. Read Paul Grahams' 'On Lisp'
      2) takes bottom-up programming to the extreme. Really does help, but takes a while to get used to.
      3) Much better to develop in...interact with the interpreter, compile individual functions and run them, change variables in a running image...

      --
      http://students.washington.edu/djwatson
    2. Re:This is not a troll, but a query... by Neil+Blender · · Score: 5, Funny

      1. You can post on slashdot when ever the topic comes up.

      2. You can think of yourself as extra cool.

      3. It'll get you laid.

    3. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      no.

    4. Re:This is not a troll, but a query... by Lisper · · Score: 5, Insightful

      "Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot."

      - Eric Raymond, "How to Become a Hacker"

    5. Re:This is not a troll, but a query... by winkydink · · Score: 1

      hey, 2 out of 3 ain't bad, is it?

      --

      "I'd rather be a lightning rod than a seismometer." -Ken Kesey

    6. Re:This is not a troll, but a query... by alacqua · · Score: 1
      Chapter 1. Introduction: Why Lisp?

      Here's an interesting snippet:

      The nearest thing Common Lisp has to a motto is the koan-like description, "the programmable programming language." While cryptic, that description gets at the root of the biggest advantage Common Lisp still has over other languages. More than any other language, Common Lisp follows the philosophy that what's good for the language's designer is good for the language's users. Thus, when you're programming in Common Lisp, you almost never find yourself wishing the language supported some feature that would make your program easier to write, because, as you'll see throughout this book, you can just add the feature yourself.

      Note: I don't quite qualify as proficient in LISP. I took two courses with LISP a long time ago. One with "Structure and Interpretation of Computer Programs" (linked in the original post) and one in AI.

      --

      Move on. There's nothing to see here.
    7. Re:This is not a troll, but a query... by tool462 · · Score: 2, Funny

      cadr(`yes `no `maybe)

    8. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      I had the same question. Paul Graham's response made me want to learn more. I also recommend reading his other essays regarding Lisp.

    9. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 3, Informative

      1. Run-time typed, like Python, with optional compile-time declarations to improve efficiency in cases where compiler can not predict types.

      Advantage is much fast code creation, with run-time safety, and option to get efficiency later.

      2. Well thought out data structures with nice language support.

      For example, ability to inline arrays and lists and symbols very conveniently in code. Ability to read complicated data structures (data files) without writing parsers, that are easier for humans to interpret and write than XML.

      3. Ability to run code during compile process.

      Enables very fancy compilation strategies, such as turning data structures into compiled code conveniently. Allows efficient, tailored extension languages to be written quickly.

      In general, Common Lisp has many features that enable big, interesting programs to be written very, very quickly.

      It has many downsides too, primarily the fact that the language spec predates many modern concepts such as concurrent threading and TCPIP. Interaction with other languages is mediocre - most implementations can call system libraries easily, but calling Common Lisp code from other languages is typically quite difficult. CL programs are rarely used as libraries by other languages.

    10. Re:This is not a troll, but a query... by ajs · · Score: 5, Interesting
      1) macros will blow your mind. Read Paul Grahams' 'On Lisp'
      2) takes bottom-up programming to the extreme. Really does help, but takes a while to get used to.
      3) Much better to develop in...interact with the interpreter, compile individual functions and run them, change variables in a running image...
      Of course, these things are true of most any functional language. IMHO, LISP is a poor choice as a starter language if you're looking for the above wins. I would start with Haskell or Scheme and move on to LISP once you had your bearings.

      Common LISP is a very old language (not as old as LISP, of course), full of the same kinds of pitfalls that any language its age or older shows (e.g. C, FORTRAN, etc). It is best to start with younger languages and work your way back.
    11. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      And when Eric Raymond talks, aelf-important asses listen.

    12. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      Yeah, well Forth is also a programmable programming language and how much do you hear about it?

      Ya, Forth, LISP... dead languages; too hard to use for little gain.

      I highly recommend all programmers learn procedural languages and functional languages, LISP is not on the list (pun intended). Most of what people claim is so great about LISP is available in regular functional languages.

    13. Re:This is not a troll, but a query... by SpaceAdmiral · · Score: 1

      Ruby is the greatest OO language I know.

      If it had online documentation just half as decent as Java, I might actually use it.

    14. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 1, Informative

      > Lisp implements everything as a binary tree.

      Along with arrays, strings, hash tables, classes, and any data structure you can think of. "Lisp only supports lists" is a myth, even the first dialects in the 60's had other data types.

      > None of these features give it any advantages over Python, Java, or a host of other newer languages.

      Lisp has better reflection, exception handling and more expressive power than any of these languages. Python especially is a sad joke -- it is hundreds of times slower than good Lisp implementations.

    15. Re:This is not a troll, but a query... by haystor · · Score: 3, Interesting

      I got my start using lisp in emacs. I highly recommend this method. There is a lot of code readily available directly in the editor both for inspection and use. There are tons of functions that directly relate to a text editor.

      This will get you familiar with some of the concepts of lists, atoms, quoting and order of evaluation. There really isn't much to a language like LISP or Scheme. The basic building blocks are few, it's largely a matter of where the line between language and library is drawn.

      The functional languages are different because a language construct can be made indistinguishable from what the user writes himself.

      --
      t
    16. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 1

      If eric raymond says it, I'm going to have to assume the opposite is true. What a pompous blowhard that guy is. What an idiotic, trying-to-sound-profound-but-failing quote.

    17. Re:This is not a troll, but a query... by Phs2501 · · Score: 1

      If you'd bother to actually browse through the book this review is about, you'd find out that all of your points are sadly incorrect. Or don't, if you'd prefer - nobody's got a gun to your head forcing you to learn anything new.

    18. Re:This is not a troll, but a query... by nicholasharbour · · Score: 1

      1. You can learn it in a day and see for yourself. 2. ? 3. Profit!

      --

      Nearly half of all people are below average
    19. Re:This is not a troll, but a query... by Tayssir+John+Gabbour · · Score: 4, Insightful
      Of course, these things are true of most any functional language. IMHO, LISP is a poor choice as a starter language if you're looking for the above wins. I would start with Haskell or Scheme and move on to LISP once you had your bearings.
      This is what I did, and it was a mistake for me. Many parts of Lisp are far "newer" than other languages because it is far easier to modernize.

      For example, Qi is built on Common Lisp and claims to have "the most powerful type system of any existing functional language." I think it's a fancy academic language, but the win is that you can combine it with the hardened industrial features of Common Lisp.

    20. Re:This is not a troll, but a query... by Florian+Weimer · · Score: 1

      Could someone proficient in LISP give me three cogent reasons to learn the language?

      It's sufficiently different from other languages outside the Lisp family so that learning it is an entertaining exercise.

    21. Re:This is not a troll, but a query... by cstacy · · Score: 1

      Your message certainly looks like a troll.
      Is this like the messages I sometimes get that say, "This message is not spam!!"?
      Your brief description of Lisp is factually wrong and quite misleading.
      Could you tell us about the Lisp software that you claim to have developed?

    22. Re:This is not a troll, but a query... by tchernobog · · Score: 2, Informative

      I can just say what it helped for me, so it's subjective, but:

      1. Opened my eyes on how recursion should really be used, and improved my software design abilities a lot, since you're encouraged on writing new small functions and then put pieces together. LISP is built on LISP, and I found it a really educative language (and that's the same reason because I dislike Java, with its too-easy-to-become spaghetti-code). Moreover, in LISP it isn't just that a program has to work; it has to do it in an elegant way.

      2. It is both a functional and object oriented programming language. Along with SmallTalk, in the '80 it revolutionized the programming language zoo, and some damn big programs started using it as an extension language (Autocad comes to mind). It has left me surprised studying it how much newer languages take from LISP, even something like Java.

      3. It is a really high level language! A lot of libraries is already ready to use. Although the learning curve is really slow at first, LISP repays you a lot of your effort. Unfortunately there aren't many books on the subject. I really welcome this book, and I'll read it asap. Me, I've learned it using the wonderful Graham's book.

      I also noted that in LISP finally you can "test code as you write", as they teach you in CS courses, but tight schedules and other languages often make that difficult in a real world scenario.
      And in a hundred of lines you can write your own ray-tracer (see always Graham's book). :-)

      Ah:
      4. Extend GNU Emacs. That's the "c00l" factor that makes you geeky, at least for me. ;-)

      --
      42.
    23. Re:This is not a troll, but a query... by Homonymous+Howard · · Score: 1
      Lisp implements everything as a binary tree.
      Wrong. Common Lisp was the first object oriented language with an ANSI standard and CLOS is still one of the most powerful object systems around.
      It does not distinguish between code and data, thus it is easy to write self-modifying code.
      This point is only correct in the sense that functions are first class objects in Common Lisp; a function object is represented quite differently from the S-expression that represents the defining form. See the section 3.2.2 Compilation Semantics in the Hyper Spec, especially the notes about conforming programs.
    24. Re:This is not a troll, but a query... by joto · · Score: 2, Informative
      Could someone proficient in LISP give me three cogent reasons to learn the language?

      Try here

    25. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      Not to bitch, but (cadr 'yes 'no 'maybe) is lisp code. That, is not ^_^

    26. Re:This is not a troll, but a query... by cstacy · · Score: 1

      That isn't even a syntactically valid Lisp expression. What's it supposed to mean?

    27. Re:This is not a troll, but a query... by daeley · · Score: 1

      Yeah, too bad it doesn't make you extra cool! ;)

      --
      I watched C-beams glitter in the dark near the Tannhauser gate.
    28. Re:This is not a troll, but a query... by fizbin · · Score: 2, Informative

      While I'm definitely a ruby fan, the ability to easily write self-modifying code (and by that I assume you include the ability to easily write code generators and to mix and match those code generators with the rest of your code - aka common lisp macros) is really something rather unique to lisp. You don't think that this provides a compelling reason to learn lisp? I admit, that's only one reason, but it's a big one.

      I've written Perl code that generates more Perl code that is then fed to eval. I've helped people write python code that generates more python code, and that is truly painful (the indentation-based grouping of Python makes this much more difficult than it needs to be). I admit I haven't done that specifically in Ruby, but I can't imagine that the experience would be very different from the same exercise in Perl.

      None of these come close to the power and ease of use of Common Lisp macros.

      I also question your statement "Lisp implements everything as a binary tree.". While it is true that the cons pair is the most common lisp data structure, and that all code is seen in terms of cons pairs, it's disingenuous to say that Common Lisp doesn't have arrays (vectors), hashtables, or structures with named slots. Often times people will produce a benchmark showing that "lisp is slow", when in fact they've gone and compared lists in lisp (implemented essentially as singly linked lists) to lists implemented with arrays in some other language, or compared assoc. lists with hashtables.

    29. Re:This is not a troll, but a query... by Locke2005 · · Score: 1

      Original post said "LISP", not "Common Lisp", and I was responding based on my experience with Lisp, not Common Lisp. I used a Xerox Interlisp D machine to verify that ACC's implementation of XNS was compatible with Xerox's back in the '80s. No, I have not used Common Lisp.

      --
      I've abandoned my search for truth; now I'm just looking for some useful delusions.
    30. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 2, Funny

      That kind of smug comment is more likely to put people off LISP. I mean, yes Eric, I'm sure fetchmail is a lot better for the fact that you once dabbled in LISP, but don't go all Godel Escher Bach on us.

    31. Re:This is not a troll, but a query... by Tayssir+John+Gabbour · · Score: 3, Informative
      Could someone proficient in LISP give me three cogent reasons to learn the language?
      Bacon-and-eggs things to help you write more robust code:

      • Powerful basic datatypes. Multidimensional extensible arrays with fill pointers. One-way/two-way/synonym streams, strings with fill-pointers, integer/rational/complex/floating-point/big/fixnum numbers, bit vectors, OOP with metaobject-protocol/{before/after/around}-methods/ multiple-inheritance/multiple-dispatch, errors/warnings/conditions. Etc.
      • Something like XML, but much more readable, built into the language. So you can perform data-directed programming without switching to XML. And unlike XML, Lisp's sexps support more than just plain text.
      • The "Conditions System", which among other things offers something far more powerful than exceptions for error-handling. Imagine exceptions that don't have to just burn up the stack.
      For the moment, let's forget pretty stuff like macros.
    32. Re:This is not a troll, but a query... by smug_lisp_weenie · · Score: 5, Insightful

      There is really only one thing you need to know about lisp- Lisp essentially has NO SYNTAX. What this means is that your program is an abstract syntax tree that goes directly into the compiler.

      Compilers in other languages first need to convert the program into an AST before compiling the code. (this is a bit of an oversimplification, but essentially true.) If you want three reasons, I can explain the repercussions of programming directly in an AST:

      Elegance: In Lisp, you don't have to worry about idiosyncracies in the head of the language designers like you do in other languages: You don't have to worry about whether AND has precedence over EQUALS (Delphi programmers know this trap) you don't need to worry when a line needs to end in a semicolon, etc. etc.

      Macros: By being an AST, Lisp lets you trick the compiler into thinking it sees other code than is actually there. This is COMPLETELY DIFFERENT than so-called "macros" in other languages- In Lisp you can turn your programming language into basically ANY programming language you want, within the language itself. Read Peter's excellent book or check out this site for more info.

      Productivity: You can program in the purely-functional style that has been shown to increase programmer productivity by having a property called "referential transparency" and having the easily serializable syntax-expression format. Basically, with Lisp you can analyze/manipulate/automate the bejeezus out of your code very easily, under the mantra "code is data, data is code".

      That's what I like about Lisp, anyway...

    33. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      that's probably the most un-cogent reason possible...

    34. Re:This is not a troll, but a query... by Tayssir+John+Gabbour · · Score: 1

      Another one is that you can use normal iteration loops -- I don't remember the last time I used recursion. Lisp has something called "loop" that's like every for(;;) loop in every language I've seen, rolled into one. And then some.

    35. Re:This is not a troll, but a query... by rainman_bc · · Score: 1

      I admit I haven't done that specifically in Ruby, but I can't imagine that the experience would be very different from the same exercise in Perl.

      Doesn't Ruby give you the ability to pipe code blocks into functions? IMO that's pretty much what you're asking isn't it?

      Forgive my ignorance - a Lisp programmer I am not.

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    36. Re:This is not a troll, but a query... by Tayssir+John+Gabbour · · Score: 1

      And the wonderful thing is that you don't have to use the "functional programming" style if you don't want to. I just use loops.

      But I'm not forced to use loops either.

    37. Re:This is not a troll, but a query... by Hosiah · · Score: 1

      Well, I had fun with Lisp for a couple of weeks. It almost reminds me of the hippy days! The primary benefit of Lisp, to me, has been that it has made learning Python easier. Lisp is just plain beautiful, as long as you don't mind enclosing everything in parenthesis. I sometimes have C programs call Emacs to interpret Lisp routines with a system call: system("Emacs --no-site-file -batch -l myLispcode.el"); for temporary routines that I intend to code in C, or hairy data-processing functions that would simply be a nightmare to code in C. You can also call Emacs to process an ELisp routine from a shell script. Of course, by the time I get to shell scripts, I'm using the Python environment.

    38. Re:This is not a troll, but a query... by Homonymous+Howard · · Score: 1
      Original post said "LISP", not "Common Lisp", and I was responding based on my experience with Lisp, not Common Lisp. I used a Xerox Interlisp D machine to verify that ACC's implementation of XNS was compatible with Xerox's back in the '80s.
      Your statement is not correct for Interlisp D either. The 1974 INTERLISP reference manual states already
      Additional data types have been added, including strings, arrays, and hash association tables (hash links) (Section 7 and 10)
      In the early '80s Interlisp-D had the same types, plus a "Record package", plus streams, etc., and was often used together with the LOOPS object system.

      And while you could get access function definition cells with getd and putd there was no guarantee that you would get back the original definition, because the definition cell could also contain compiled code (cexprs, or more precisely something for which fntyp would return c[f]expr[*]). Of course you could write self modifying code by playing around with the function definition cell (or by using advise, which seems to make a comeback in AspectJ) but that was something that was in my experience mostly done during debugging sessions and not during normal program execution.

    39. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      He confused quote with backquote and supplied multiple arguments rather than providing a single list of arguments, but (cadr '(yes no maybe)) is the same as (car (cdr '(yes no maybe))). You can also use things cddr, caddr, and such. I believe the standard requires that implimentations support all such functions having up to 3 a's and d's.

    40. Re:This is not a troll, but a query... by anactofgod · · Score: 2, Informative

      I am an ex-Lisper who strayed from the One True Language and am now in the process of regaining proficiency to rejoin the Lisp Priesthood. My motivation is that I am tired of the limitations I hit due to the deficiencies inherent in all the other supposed "modern" popular programming languages I've encountered. I also remembered really *enjoying* the whole process of rolling Lisp code, a joy I lost long ago when I strayed into the mass market of more socially acceptable programming languages.

      The deficiencies of modern languages I speak of above are not necessarily those of capability (though those exist), but are primarily of language design. Most languages are designed with the goal of increasing the productivity of the average programmer. Lisp's design was entirely about elegance, simplicity and power. I can give you lots of reasons why Lisp is better than insert-your-favorite-programming-language-here, but that will just devolve the conversation into a jihad. So, let me tell you what Lisp is fantastic at.

      Actually, you know what? I'm not going to reiterate that which others have stated. If you really are interested, let me just point you to a couple of sites to get you started on your journey of discovery. Read Paul Graham's essays/articles, the first two chapters of Peter Siebel's book available on-line, this essay on Lisp's prowess as a rapid prototyping language and this paper on why the future of the (semantic) Web may lie with Lisp. Then, if you appetite is whetted, Google for more info, download a flavor of Common Lisp, work thru Seibel's book, and experience it for yourself.

      Or not. If you're perfectly satisfied with whatever flavor you how you do your work, there is absolutely no reason to learn ANYTHING new, is there?

      Learning Lisp. It will take you back to the future.

      --

      ---anactofgod---

      "Equal opportunity swindling - *that* is the true test of a sustainable democracy."
    41. Re:This is not a troll, but a query... by sketerpot · · Score: 1

      And I'm not a Ruby programmer---but the sort of code generation you describe has three major disadvantages compared with Lisp's. First, it requires heavy string manipulation, which is ugly and error-prone. Second, using eval (or the Ruby equivalent) at runtime is slow. Third, this sort of thing falls into the realm of Scary Hack World in Ruby, while it's well supported in Lisp.

    42. Re:This is not a troll, but a query... by sketerpot · · Score: 1

      Better yet, and actually valid code: (second '("No." "Yes!" "Maybe..."))

    43. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      Another strong point of Lisp is that it permits you to work in pretty much whatever manner you please. Working in an imperative language like C has always been somewhat confinging for me since I'm forced into the machine's eye view of the code. Lisp lets you impliment algorithms as you understand them.

    44. Re:This is not a troll, but a query... by sketerpot · · Score: 1
      You probably know this, but be careful with recursion. The other day I saw a function someone had written which used recursion to cons up a list. I rewrote it into a function about the same size which used explicit looping (with nasty details hidden by the LOOP macro). The new version was clearer and about 50 times faster (and used less memory).

      Use recursion wisely. You can use it for all iteration, but you shouldn't.

    45. Re:This is not a troll, but a query... by Theatetus · · Score: 1

      (values
      "lisp is one of the best tools for prototyping large applications"
      "lisp allows a programmer to use just about any programming philosophy: procedural, functional, object-oriented, aspect-oriented, etc. This gives you more flexibility in designing your project and doesn't give you artificial straightjackets"
      "despite myths to the contrary, lisp has excellent native code compilers and bindings to almost anything you can think of: databases, graphical toolkits, network protocols, system calls, etc.")

      --
      All's true that is mistrusted
    46. Re:This is not a troll, but a query... by sketerpot · · Score: 2, Interesting

      I think the parens confuse almost everyone. They gave me a headache until I learned the editor keystrokes for manipulating them easily and learned to look at the indentation instead of the parentheses. Now I have trouble with other languages. It's amazing how anything different from what we're used to (whatever we're used to) seems hard to use, isn't it?

    47. Re:This is not a troll, but a query... by Ulrich+Hobelmann · · Score: 4, Interesting

      Really? Which functional language has macros?

      Which functional language lets you redefine stuff in a running image?

      Haskell might be good for real functional programming, but in Lisp you don't do that much functional programming.

      I learnt Scheme first, actually, and I'm not that impressed, just like Haskell didn't impress me that much. Scheme is a stripped down Common Lisp with nicer syntax, a weird macro system, and an emphasis on functional programming.

      And I don't see in what way Common Lisp has old warts, compared to FORTRAN or C...

      It was standardized in 1984, with an object system. That's not too bad, IMHO, considering that Java is just a worse smalltalk-80 and that other C dialects similarly seems to be stuck with '70s technology, compared to Common Lisp.

    48. Re:This is not a troll, but a query... by beforewisdom · · Score: 1
      1. You can post on slashdot when ever the topic comes up. 2. You can think of yourself as extra cool. 3. It'll get you laid.
      Okay, lets have a contest for guessing which one of these three things is not true!
    49. Re:This is not a troll, but a query... by omigod!kenny · · Score: 1

      1. Lisp is extensible. Long story. Check out Graham, esp. his "On Lisp". In brief, when working on a large app you can make it look as if Lisp is a language designed for your problem domain. 2. Lisp is dynamic, does not grind you down with static typing. This is the direction you are headed anyway with Python, Groovy, Perl, et al, but Lisp is the ideal to which these languages are evolving. Save yourself two years and learn Lisp now. 3. CLOS, the object system to die for (over flow condition) 4. mature, ANSI-standardized. Why wait for Groovy, Perl, and Python to stop changing? 5. native-compiled: fast, efficient 6. the parentheses! They allow you to edit (cut, copy, paste, delete) in meaningful chunks, not lines and characters. They also make possible automatic indentation, a very nice win if you think about it. 7. FFIs let you talk to C if you need library support. And those are just the highlights. kenny

    50. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 1, Informative

      Common LISP is a very old language

      Common Lisp (!) was created by amalgamating several other variations of LISP into an ANSI standard that was ratified in 1994.

      Considering most C code out there now is on the ANSI C 1989 revision I don't see how this argument flies.

      CL has also had support for imperative, functional, and OO programming since it's creation. (You can use any one of the programmin methods (or all of them). CL doesn't impose a paradigm on you -- you choose whichever one you want.)

      Throw in handling of complex number (1+2i) and highly accurate math (20/30 results in a return value of 2/3, not 0.66666...7) and you now can now see why many people like it.

    51. Re:This is not a troll, but a query... by aarku · · Score: 1

      Macros do indeed rule in LISP. Wikipedia provides a neat example.

    52. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      Lisp killed my dog. I'm learning it so I can find its weakness, then I'll attack!

    53. Re:This is not a troll, but a query... by shutdown+-p+now · · Score: 1

      Common Lisp is the only industry language which has full-featured multimethods in its object system (CLOS). It is a very powerful concept, level above the usual message-passing OOP abstraction, which, unfortunately, few are aware of.

    54. Re:This is not a troll, but a query... by turbidostato · · Score: 1

      "I got my start using lisp in emacs. I highly recommend this method"

      But, but... this way I should use emacs!

      Well, for now I'll stick to my ubereditor... Notepad, no less.

    55. Re:This is not a troll, but a query... by e40 · · Score: 3, Insightful

      If you think that macros in any language are better than the ones in Lisp you are very uninformed... and you clearly never used Lisp. Lisp macros manipulate and transform Lisp expressions. Once you have used them you will be completely amazed at how powerful this is.

      As for starting with younger languages... cripes. Common Lisp became an ANSI standard in 1994. It continues to evolve and has two commercial companies behind it, and many open source projects.

    56. Re:This is not a troll, but a query... by rsheridan6 · · Score: 1
      It seems to be a widely held misconception that Lisp is oriented towards functional programming and recursion; actually, tail recursion is not required by the standard, it's only provided in an obscure, implementation-dependent, often declaration-dependent manner. Real Common Lisp code generally makes liberal use of iteration and assignment.

      Maybe people take a class in Scheme and get confused.

      --
      Don't drop the soap, Tommy!
    57. Re:This is not a troll, but a query... by cookiepus · · Score: 1

      For example, Qi is built on Common Lisp...

      Just wondering, how did you hear about Qi? Mark Tarver taught one of my undergrad courses... I haven't heard Qi mentioned anywhere else.
      Thx

    58. Re:This is not a troll, but a query... by quanticle · · Score: 1

      Just admitting to using notepad on Slashdot should earn you some sort of award for bravery.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    59. Re:This is not a troll, but a query... by fizbin · · Score: 3, Informative
      No, that's not what I'm asking for; although I will admit that I like Ruby's ability to pass a following code block into any function, this is really something completely different. (For non-rubyers: the poster is talking about a facility that's similar to being able to pass an anonymous function as an argument with nice, clean syntax that doesn't get in your way - similar to the way that the perl builtin sort and map functions let you pass in a block)

      A macro basically allows you to rewrite code completely, reaching into the bowels (if necessary) to rip out and mangle what needs to be done.

      A basic example is the setf macro. This macro is used for basic assignments:
      (setf captain "Picard")
      (setf answer (+ 23 42))
      Except, of course, that the first argument can be more than just a simple symbol:
      (setf (aref array 0 10) new-value)
      (setf (car mypair) mynewcar)
      So far... so what, right? After all, this "fancy" syntax is just equivalent to the java code:
      array[0][10] = new_value;
      mypair.car = mynewcar;
      Okay, but how about this - suppose I define some functions dealing with a simple berkeley-style database. Say, (get-from-db dbref keyvalue) and (set-to-db dbref keyvalue newvalue). Now, if I set things up properly, I can make setf work with these functions too, so that the user can do:
      (setf myprevval (get-from-db id key))
      ; some calculations on the previous value here
      ; do some other stuff here
      ; some calculations to get the new value
      (setf (get-from-db id key) newvalue)
      See how I never explicitly call my database setting function? The last line there never actually calls my get-from-db function - instead, it reaches into the parentheses and rewrites the code so that what happens is a call to set-to-db.

      That is, the user never has to know about the set function. Essentially, setf means "here, in the code, where I've said setf, instead go ahead and use whatever the appropriate setter function is for a reference of this type". (when I defined my db functions, I would have to call some macros to tell setf about get-from-db and set-to-db)

      Now, for this specific case - creating a unifrom set syntax for any "get"-type function you wish - Ruby has specific explicit syntax support. (just name the "set" method the same as the "get" method but add an "=" to the end of the name) Lisp, however, handles setf through the more general macro mechanism. This means that it can be extended in a bunch of different ways. For example, Lisp defines incf to mean roughly what C's "++" operator does, except again without special language support. (And incf will automaticaly take advantage of the setup I've already done for setf)

      In order to do its magic, setf has to be able to access the reference (get-from-db id newval) exactly as I typed it, and has to be able to rip apart and inspect the innards. This is something only a macro can do.
    60. Re:This is not a troll, but a query... by Fahrenheit+450 · · Score: 1

      So, you don't hang out at Llambda The Ultimate then?

      --
      -30-
    61. Re:This is not a troll, but a query... by Tayssir+John+Gabbour · · Score: 1

      Mark announced v6.1 recently. I'd heard of it once in an old post by Carl Shapiro, but didn't explore it until this announcement. I was impressed since it put a number of senseless flamewars to rest, and announced it on LtU.

    62. Re:This is not a troll, but a query... by sv0f · · Score: 1

      1) macros will blow your mind. Read Paul Grahams' 'On Lisp'

      Of course, these things are true of most any functional language.


      (1) is absolutely not true of functional languages.

      The rest of your post is also full of errors (e.g., Common Lisp is as old as C and Fortran).

    63. Re:This is not a troll, but a query... by sv0f · · Score: 1

      Most of what people claim is so great about LISP is available in regular functional languages.

      Lisp is a multiparadigm language. For example, it was the first ANSI-certified language with an OO system.

    64. Re:This is not a troll, but a query... by zorander · · Score: 2, Interesting

      While self modifying code in ruby is not practical, macro-like code generation is pretty clean. They're not full read-macros like lisp, but I think they lend themselves to more readable/extensible code. In lisp, if you use a read macro, and it isn't properly documented, then the users of the function will be confused by why things are being quoted until they find the source or read the docs. Lisp macros are also quite difficult to read and modify later if you didn't write them.

      Here's an example of method generation in ruby:

      CALLBACKS.each do |method|
      base.class_eval -"end_eval"
      def self.#{method}(*callbacks, &block)
      callbacks block if block_given?
      write_inheritable_array(#{method.to_sym.inspect}, callbacks)
      end
      end_eval

      This is from the rails source code (which takes metaprogramming in ruby to an extreme I haven't witnessed previously, even in lisp). If you configure your text editor not to parse here documents, then the code you're generating will be highlighted correctly (and with the right %X{} sequence, it will almost always be highlighted).

      No, it's not read macros, but I've seen read macros which generate hundreds of lines of lisp in the most horrid fashion. This is no good. I'd rather have a more controlled mechanism (and more object orientation).

      That said, Lisp is a lot of fun, and I look forward to the next time I have substantial reason to use it.

    65. Re:This is not a troll, but a query... by mattknox · · Score: 1

      1: Learning lisp will make you a better programmer and thinker.

      2: Lisp tends to be much more productive than other languages, so you can get more done with it than with most other languages, in general.

      3: Lisp represents a pretty good approximation to the vanishing point toward which languages seem to be evolving, and being in the future before everyone else is cool and good for you.

      1: Learning things that are meaning-heavy, as opposed to fact-heavy, tends to stretch your brain and make you think different (and better) in the future. Learning C#, C++, java, etc., is mostly minutia: getting all sorts of syntax down, remembering which class does what, and fitting all manner of facts into your head. Learning lisp tends to be a process of learning whole new methods of thinking, which tend to be enormously powerful.

      2: http://www.norvig.com/java-lisp.html

      3: Graham says this much better than I can.

    66. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      Argh! Don't do that. Emacs Lisp is the cruftiest, most ancient and unbearable dialect of Lisp currently in existence. Common Lisp is a real, modern, usable language.

    67. Re:This is not a troll, but a query... by TheOtherChimeraTwin · · Score: 1
      Only one reason is needed really:
      "Lisp is the red pill."
      -- John Fraser, comp.lang.lisp
    68. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0
      lisp is the greatest language period.

      i doubt you'll find proponents of other languages who have the cojones to make that assertion.

    69. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      You don't know Lisp. You've never met OO until you've met CLOS.

    70. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      For "a day" read "you'll still be learning in 10 years". But yes, do see for yourself.

    71. Re:This is not a troll, but a query... by thisgooroo · · Score: 1
      spoken with the authority of true ignorance:

      Lisp implements everything as a binary tree.

      could you please enlighten us about your definition of binary tree? i have never heard this claim before, though quite a few people claim (also incorrectly) that in lisp everything is a list. apparently the up to 30 to 40 years old news that lisp has arrays, strings, symbols, numbers, hashtables, structures, objects, etc hasn't made it to them yet

      It does not distinguish between code and data,

      try to execute the data (1 2 3 4 5) or (this is dat) and you will notice that it find out that it very well makes this distinction. what is true that the source encoding uses an easy to use data structure, which has the advantage that all the power of lisp is available for manipulating source code, resulting in a macro system that hardly any other language can match

      thus it is easy to write self-modifying code.

      please demonstrate how to do that. you can assign new values to variable, and since functions are regular objects, you can replace a function definition by a new definition. but since modern lisp system compile code to machine language or byte code, you can modify the source representation as much as you like without effecting your code until you recompile the altered definition. this is a far cry from what is usually understood under "self modifying code"

    72. Re:This is not a troll, but a query... by haystor · · Score: 1

      A person new to the language doesn't need to start programming in emacslisp, but it wouldn't hurt for them to start learning lisp using emacs.

      Just running through a lot of the basics, I haven't found a better place than the emacs buffer to try things out:

      (setq v '(1 2 3))
      => (1 2 3)
      (car v)
      => 1
      (cdr v)
      => (2 3)
      (cadr v)
      => 2
      (cons 0 v)
      => (0 1 2 3)
      (car v)
      => 1

      Depending on talent as a programmer, you may want to spend a day or 6 months messing around with this. If you're like me, you spend 2 years writing helpful functions in emacs for producing code in other languages before ever seeing a real lisp implmentation.

      Just remember that the way you first saw things isn't necessarily the best way. But that's something programmers should try to remember in general.

      --
      t
    73. Re:This is not a troll, but a query... by coopex · · Score: 1

      FOOLS! YOU ALL WORSHIP FALSE GODS. THE ONE TRUE LANGUAGE IS BASIC! This text is just here to make the lameness filter make it think that I'm not using so many caps. Really, who came up with the stupid idea that all caps is like yelling. Who de doo, I'm offendend by capitalization. So would the corollary be that typing in all lowercase is like whispering. Well, I'm gonna try this now and see if it works.

      --
      The road to hell is paved with good intentions.
    74. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      And once you've met CLOS, you know what it means to be forcibly sodomized by OO.

    75. Re:This is not a troll, but a query... by drew · · Score: 1

      You don't have to worry about whether AND has precedence over EQUALS

      If you parenthesize properly, you don't have to worry about this. or, as larry wall put it:
      "when in doubt, parenthesize. at the very least it will let some poor schmuck bounce on the % key in vi."

      --
      If I don't put anything here, will anyone recognize me anymore?
    76. Re:This is not a troll, but a query... by WWWWolf · · Score: 1
      I would start with Haskell or Scheme and move on to LISP once you had your bearings.

      I'd tell people to start with Scheme, all the while looking at how the things they learn in Scheme get done in Common Lisp.

      Haskell, in my opinion, wouldn't be that great as a starter language. For someone who hasn't used functional languages, Lisp dialects are usually confusing but I'd guess Haskell would be downright incomprehensible. Monadic I/O, anyone? At least Lisp lets you use I/O side effects where they make sense =)

    77. Re:This is not a troll, but a query... by ajs · · Score: 1

      I appologize about macros. I have had only brief exposure to Haskell, and knew that it had macros, so (it being a functional language and all) I just assumed that that meant macros ala LISP. Clearly I was wrong.

      As for Scheme, here's a reference that discussses schemem macros

      Overall, I wasn't trying to start a language war. I have a great deal of respect for Common LISP. It is, however, huge and quirky, so I generally don't tend to direct people at it who just want to learn functional programming. That's a bit like giving someone an F-18 to learn how to fly.

    78. Re:This is not a troll, but a query... by aurelien · · Score: 1

      It was standardized (ANSI) in 1995, not 1984.

      1984 was the year of the first Common Lisp draft and then it lacked the object system (CLOS) and the Condition System.

      --
      aurelien
    79. Re:This is not a troll, but a query... by s1234d · · Score: 1

      You start to realise: - How many "advanced" modern language features Lisp had 20 years ago. - That you've been missing out on some serious fun. Lisp is not right for everything, but it's suitable for far more tasks than people realise, and very often is dramatically better than "industry standard" languages. There's actually a bit of a debate in Lisp circles about whether they should bother trying to advertise this fact or just profit from it by bidding for jobs at a much lower cost.

    80. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      For example, Qi is built on Common Lisp and claims to have "the most powerful type system of any existing functional language."

      Yes, and did you see the recent thread on c.l.functional where its author attempted to justify that claim and was comprehensively and conclusively demolished by all the other academics?

      Qi's type system is interesting, but it is very disputable whether it offers anything over Haskell's.

    81. Re:This is not a troll, but a query... by smug_lisp_weenie · · Score: 1

      > if you parenthesize properly...

      Of course, if you _really_ parenthesize properly, you'd end up with something that looks just like Lisp :)

    82. Re:This is not a troll, but a query... by Tayssir+John+Gabbour · · Score: 1
      Yes, and did you see the recent thread on c.l.functional where its author attempted to justify that claim and was comprehensively and conclusively demolished by all the other academics?

      Qi's type system is interesting, but it is very disputable whether it offers anything over Haskell's.

      This? If so, it doesn't fit my definition of "demolished." More like a couple guys disagreeing in the typical academic's handwavy way. Like pre-makeover Lambda the Ultimate.

      They might be absolutely right, of course, but their arguments weren't compelling to me.

    83. Re:This is not a troll, but a query... by ultrabot · · Score: 1

      I've helped people write python code that generates more python code, and that is truly painful (the indentation-based grouping of Python makes this much more difficult than it needs to be).

      eval-ing code is also considered ugly and nonpythonic in python circles. And it is. There is almost always an alternative.

      Also, if the whitespace block structure becomes an issue, it's trivial to preprocess something like

      def f(x,y) { while 1 { print x,y } }

      into equivalent indented syntax.

      My point being: this is not a big issue, and it can be easily circumvented.

      --
      Save your wrists today - switch to Dvorak
    84. Re:This is not a troll, but a query... by Ulrich+Hobelmann · · Score: 1

      Oh, didn't know that.
      Thanks.

    85. Re:This is not a troll, but a query... by Ulrich+Hobelmann · · Score: 1

      Don't worry. Just wanted to clear things up...

      The Scheme macro artice you mention however, isn't too good an introduction, IMHO.

      Scheme macros are one reason why I'm learning Common Lisp now ;)

      Lisp (unlike Scheme) isn't really about that much functional programming; it has a powerful object system and uses macros (for iteration for instance) extensively.

    86. Re:This is not a troll, but a query... by ajs · · Score: 1

      Yep, I agree. I was referncing that macro article only to point to something for the sake of this conversation. I understand there are some excellent "so you want to learn to program" books for scheme, but I already knew C, BASIC and Modula-2 when I came across scheme for the first time.

      Someday I have to go back and really LEARN scheme.

    87. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      since it's creation

      "its".

    88. Re:This is not a troll, but a query... by ajs · · Score: 1

      " Common LISP is a very old language

      Common Lisp (!) was created by amalgamating several other variations of LISP into an ANSI standard that was ratified in 1994.
      "

      This thread is starting to tread into language-war territory, and I don't want to go there, but suffice to say that Common LISP (as described in the 1994 standard) is the descendent of several forms of LISP which stem from roughly the same time period as C and FORTRAN give-or-take 20 years. K&R C is not ANSI C, but we still describe the C language of today (C9X) as being "30 years old". So too, we describe Common LISP as being at least as old as the LISP dialects that were merged and extended to create it in the first place.

      And excellent refernce can be found on lisp.org's history page.

      "CL has also had [...features...] Throw in [...features...] and you now can now see why many people like it."

      That's great. I like it quite a lot myself. If you thought this was some kind of anti-Common LISP rant of mine, you are sorely mistaken! I work for a company that uses Common LISP commercially, and it pays my bills. I was talking about appropriate choice of languages to introduce programmers to certain concepts. For that specific, narrow purpose, I was suggesting that CL was at least not the only choice (and IMHO, not the best choice).

      footnote: I do not speak for my company. If my above comments made you think that I do, please disabuse yourself of such notions.

    89. Re:This is not a troll, but a query... by Khelder · · Score: 1

      I'll try to restate his point more pragmatically.

      There are different styles of programming. To name a few styles (with a representative language):
      * Imperative: C
      * Object-oriented: Smalltalk
      * Functional: LISP
      * Declarative: PROLOG

      When you're programing well in a certain style you think differently than when you programing well in another style.

      The pragmatic reason to learn languages in other styles is it'll make you a better programmer, in all languages you know.

      LISP is a good one to learn because it's the canonical functional language.

    90. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      Who de doo

      "Whoop".

    91. Re:This is not a troll, but a query... by Stanistani · · Score: 1

      I appreciate all of the responses,and had no realization of LISP's reach.

      Reading these this morning reminds me of why I come to Slashdot every day...

    92. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      Actually, it's an excellent question.
      3 Reasons to learn Common Lisp: (there are many others, but most of them can also be gotten by learning any modern dynamic language...not these)

      1) Macros. I second the other posts...this is the most fundamental reason to learn lisp, in that this is _why_ it is chock full of other, very modern features. But you can use Common Lisp and love it without actually writing your own macros. It's a bit like the C preprocessor, but processing syntactic objects instead of a text stream of code, and the syntax is regular so its easy to read and write code. Think Perl source filters that never break. (Somebody made this analogy in a good blog entry somewhere.) Until you read Graham's On Lisp, which is on the web for free at http://www.paulgraham.com/onlisptext.html (though I like the paper version, it can be hard to find), you won't really get what macros can do. Other texts just touch on them briefly.

      2) CLOS. Common Lisp Object System is far more flexible, powerful, and innovative than any other OO system I know of (including Smalltalk, Python, Ruby...and comparing Java or C++ to CLOS is just funny.) A great book to learn the real meat of CLOS (not introductory) is Object Oriented Programming: A CLOS Perspective, but first read the CLOS chapter in Paul Graham's ANSI Common Lisp (in print and a great intro), his On Lisp, or the book reviewed here (which I haven't read entirely, but sounds quite good). One note: it hasn't got much in the way of encapsulation. Of course, using #1 and the package system and gensyms, you could add it...but that's sort of fighting the design. So if you're an OO encapsulation nazi you might like Ruby better.

      3) Lexical closures. Ruby calls these blocks (though CL's syntax is a bit simpler). It sounds unimportant, but it's essentially a way to simulate a "micro-object" without creating a class, or even an object, explicitly. This sounds wierd, but you can do things like stuff a hash table full of little objects, or pass them to other functions, and generate OO-like behavior with much simpler code. Design patterns people can think of Decorators, Commands, Adaptors, Bridges, etc easy and clean.

      If you use Ruby, you'll know that blocks (#3) are essentially what makes it (IMHO) one of the best dynamic languages out there, other than lisp. (It beats CL in one regard in that it has continuations, but that's another story.) You can get #3 in a few other good dynamic languages - I think Perl has them (?). Python and Java have read-only lexical scope in anonymous inner classes, but in Java the syntax is baroque, and the read-onlyiness/final-ness of captured objects is a limitation that Ruby and CL do well without.

      So #3 can be gotten a few other places. But trust me that it utterly _pales_ in power in comparison to #1 and #2, and they are afaik only available in Common Lisp (and to some degree Dylan, or Scheme if you bolt on a CLOS-like package...both of which are also Lisp dialects). All three combine to enable some amazing design patterns that are not possible in any other languages than CL.

    93. Re:This is not a troll, but a query... by boelthorn · · Score: 1

      You will not experience the power of macros in either Haskell (has none?) or Scheme (most dialects have "hygienic macros" which are quite a pain in the ass). And btw, Common Lisp is not as old as you think. The standard dates from 1994 and it has its roots in the early 1980s.

      I really do not know what kind of pitfalls Common Lisp shares with C or Fortran. I never had any Common Lisp application core dumping...

    94. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      ahahaha

    95. Re:This is not a troll, but a query... by fizbin · · Score: 1
      Ok, so doing this in ruby is significantly less painful than it is in perl, primarily because in perl you constantly have to watch which $ symbols you need to backslash and which you don't. Ruby, by having a string-interpolation syntax that looks nothing like its variable-access syntax, avoids this mess. (Because of this, in perl I end up just quoting the code I'm dealing with in q[] and then doing regular expression substitutions rather than relying on string interpolation)

      I'm not talking about read-macros, I agree that those can get truly hairy.

      However, the thing that's really nice about lisp macros (just regular macros, not read-macros) that's not handled in ruby there is that the macros create special forms. What I mean is that to invoke a function which creates a method like that in ruby you have to say:
      macro_thing('new_method_name')
      That is, you have to quote the new method name. (or use ruby's symbol syntax, which is a shorthand for quoting and calling intern) In lisp, the macro can handle all the quoting for you so that you just say:
      (macro-thing new-method-name)
      In other words, there's no second-class status imposed on macros as compared to built-in language constructs. This means that extending the language itself is natural and easy for someone writing libraries of code in the language. I believe this feature is unique to Lisp and Forth. (though I suppose that bits could be emulated through perl source filters, but those are hairy for reasons previously mentioned)

      Huh. Actually, thinking about it, a string interpolation syntax that doesn't get in the way of writing stuff that is code combined with a very light-weight quoting syntax (:new_method_name) goes a long way towards lisp macros, at least towards simple ones. (I'd hate to write a macro like that in ruby that needed to expand to code that did a bunch of string interpolation, for example, which tends to put the kibosh on macros that write macros)
    96. Re:This is not a troll, but a query... by sleepingsquirrel · · Score: 1
      Really? Which functional language has macros?
      Maybe you should look at Template Haskell...
      Template Haskell is an extension to Haskell 98 that allows you to do type-safe compile-time meta-programming, with Haskell both as the manipulating language and the language being manipulated.

      Intuitively Template Haskell provides new language features that allow us to convert back and forth between concrete syntax, i.e. what you would type when you write normal Haskell code, and abstract syntax trees. These abstract syntax trees are represented using Haskell datatypes and, at compile time, they can be manipulated by Haskell code. This allows you to reify (convert from concrete syntax to an abstract syntax tree) some code, transform it and splice it back in (convert back again), or even to produce completely new code and splice that in, while the compiler is compiling your module.

      ...
      Which functional language lets you redefine stuff in a running image?
      Erlang allows you change stuff in running code...
      12.3 Code Replacement

      Erlang supports change of code in a running system. Code replacement is done on module level.

      The code of a module can exist in two variants in a system: current and old. When a module is loaded into the system for the first time, the code becomes 'current'. If then a new instance of the module is loaded, the code of the previous instance becomes 'old' and the new instance becomes 'current'.

      Both old and current code is valid, and may be evaluated concurrently. Fully qualified function calls always refer to current code. Old code may still be evaluated because of processes lingering in the old code...

    97. Re:This is not a troll, but a query... by Mornelithe · · Score: 1

      And you think that the Qi inventor's argument is more convincing? I looked at his page (especially the typing section on Qi for ML programmers), and scanned through the typing sections of his book (Functional Programming in Qi), and I didn't see any specific example of: "These types can be expressed/decided in Qi, but not in Haskell."

      Do you know of any links about what makes Qi's type system "the most powerful"? Or what his definition of "powerful" is? It seems like it might be more convenient for expressing some types (I find it akin to the difference between logic languages and functional languages; in fact, I think that's the actual difference between the type systems. Logic languages give you some things for free, but they aren't universally "more powerful" than functional languages), but none of his examples immediately strike me as being impossible to do in Haskell; just different.

      "Sequent calculus is better than Haskell!" doesn't seem particularly compelling either.

      --

      I've come for the woman, and your head.

    98. Re:This is not a troll, but a query... by zorander · · Score: 1

      I see what you're saying and I don't disagree that LISP's macros are more powerful. I'm not sure they're needed in a language as syntactically rich as ruby. Because LISP lacks syntax, you need to go to lengths to create it. As a result, multiple LISP codebases appear sufficiently different to disturb developer mobility between projects. If a function call is a function call, then you can read code and know what it means. If it's a special form, something completely different could be going on and the usage looks the same.

      The other thing you could do in ruby to prevent nasty string interpolation is to build a Proc object (a closure of sorts) that parametrizes the call. I'm not sure what a great idea it would be to define the block outside of the macro (since it is a closure and would be in the wrong context), but if it was written properly, I suppose it would be alright.

      Having worked with a large lisp system and a medium sized ruby system, I'll say that from a pragmatic perspective, ruby has enough meta-programming support with a clear enough syntax that its benefits outweigh those of lisp whose syntax can be hard on the eyes, especially for new developers.

    99. Re:This is not a troll, but a query... by Tayssir+John+Gabbour · · Score: 1

      Read the usenet thread again.

      The person I responded to argued, "Yes, and did you see the recent thread on c.l.functional where its author attempted to justify that claim and was comprehensively and conclusively demolished by all the other academics?"

      When you read that thread, you'll see that "All the other academics" out to demolish his claim consist of Matthias Blume. ;) In only TWO of his paragraphs.

    100. Re:This is not a troll, but a query... by master_p · · Score: 1

      Which functional language lets you redefine stuff in a running image?

      And why is that needed? millions of programs run just fine without that sort of trickery.

      considering that Java is just a worse smalltalk-80

      And why Java is worse than Smalltalk-80. I smell bullshit, again. Smalltalk lacks namespaces, and one has to carry the Smalltalk image together with the application. The Smalltalk gui is ancient, and the Smalltalk syntax just not make any sense. Plus Smalltalk is really slow, since all 'messages' are not just virtual, they are actually discovered in run time through message maps.

      that other C dialects similarly seems to be stuck with '70s technology, compared to Common Lisp

      It's funny that when /. refers to any language other than C, it's a God language, can do everything faster, cleaner and better...well, guess what? it is not. The success of it proves it. It might be due to lack of performance, difficulty in interfacing with O/S and other routines, lack of standardization, the fact is that LISP and all the other languages keep seeing the dust of C and its derivatives (C++, Java and C#).

    101. Re:This is not a troll, but a query... by Ulrich+Hobelmann · · Score: 1

      I'm not saying that you need to redefine stuff in a running image, but if you ever do, Lisp can do that, too.

      I agree to your Smalltalk criticisms. It's kind of old. However: why does the Smalltalk syntax "just not make any sense"? Who defines what makes sense and what doesn't? IMHO Smalltalk syntax is much saner that Java or Python.

      Smalltalk isn't slow, either. Maybe some implementations are. Java was slow for a long time too (arguably still is), and only after millions of programmers took it up, making Java maybe the most popular language in the world, and years of development, is Java faster...

      I didn't say anything was God's language. I was saying that C dialects seem stuck in the '70s. That's my opinion. You don't even argue or refute that. BTW I'm not liking Lisp because it's on /. I'm discussing here on /. in this article because I like Lisp.

      The (lack of) success of a language doesn't prove anything, by the way. Or do you think that Java is the best language around, just because it gets more /. coverage and has more programmers?

      Eat shit. Millions of flies can't be wrong!

    102. Re:This is not a troll, but a query... by Mornelithe · · Score: 1
      Right, I read that too. I don't agree that his claims were "demolished."

      Essentially, the fellow you mentioned said that his claims of the "most powerful type system" weren't much more than hype. I'm not enough of a guru to say whether or not that's the case. However, I haven't seen any examples put forth that his sequent calculus-based type system has more expressive power than Haskell's system (I don't know ML's type system, so I can't comment on that).

      As I said, the main difference I see between the type systems is the difference between logic and functional programming languages. For example, in a functional language like Haskell, you can define size of a list like so:
      size [] = 0
      size x:xs = 1 + size xs
      Which computes the size of a list. Whereas in Prolog you do the following:
      size([], 0).
      size([H|T], N) :- size(T, N1), N is N1 + 1.
      Now, you can use this to compute the size of a list (size([1, 2, 3], X)), or you can use it to compute all lists of size 3 (size(L, 3)), and so on. Unification in logic languages gives you the ability to use "functions" forwards and backwards, so to speak, which is significantly different than functional languages.

      Some of the Qi typing examples remind me of programming such logic style predicates (specifically, the binary number example, where he defines the left and right definitions of binary numbers). This is probably no accident, as he says that sequent calculus is a notation for first-order logic (I believe), while Haskell's type system is based on a derivative of Lambda calculus. However, Prolog is not more powerful than Haskell, and vice versa. They're both Turing complete, after all.

      I suspect that his claims of "the most powerful type system" really boil down to "the most convenient type system for defining some types," unless someone can provide evidence to the contrary (which I'll gladly read and probably not understand :)). That's nice, but I'm not sure "powerful" is the right word to describe it. When he says the "power" of a type system, I think about its ability to give actual types to functions (for example, I don't believe the Haskell 98 standard doesn't allow for rank-N polymorphic types, while most actual Haskell compilers do. So the type system of the actual compilers is more powerful than that of the standard, in that they can correctly represent the types of some functions that the standard cannot). As far as I can read, the inventor of Qi hasn't shown that there are types that can be represented in Qi that can't be represented in Haskell.

      Another useful feature of good type systems is type inference, which both Haskell and Qi have (I think). However, the author doesn't give any examples about Qi's type inference being more powerful than Haskell's either. For example, can Qi properly inference the type the Y combinator given as a lambda expression (\f -> (\g -> f $ g g) (\g -> f $ g g)) (I think it requires inferencing a rank 2 polymorphic expression, which may be undecidable, at least in Haskell's "less powerful" type system :))? As far as I can tell, the only reason that construct in Qi is that you can turn the typing system off. :)

      Anyhow, I don't agree that either side demolished the other. However, the creator of Qi says, "The type system is more powerful than Haskell!" without any examples or definitions of "powerful," and a random guy on comp.lang.functional says, "it's arrogant to make such an assertion without any proof." Frankly, I agree more with the latter. Show me something that can be done in Qi's type system that can't be done in Haskell's. I'm willing to learn.

      Sorry for the rambling post. Too many beers this afternoon. :)
      --

      I've come for the woman, and your head.

    103. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0
      Lisp (note the spelling!) is not a functional language. The canonical functional language is probably Haskell. Which is an excellent language, but not at all like Lisp.

      Your table should start out like this:

      * Imperative: C, Lisp
      * Object-oriented: Smalltalk, Lisp
      * Functional: Haskell, Lisp

    104. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      I think you're confusing the language with a particular implementation. Smalltalk doesn't have to be slow. The HotSpot VM was adapted and then further developed for Java; it originally targeted Self and Smalltalk!

    105. Re:This is not a troll, but a query... by Mornelithe · · Score: 1
      If you don't mind me replying to myself...

      Reading around on comp.lang.functional a little more, I noticed some other posts by him, and one mentioned (in response to a question much like mine), that a good example was typing prime versus composite numbers. So you could do something like this (in my own pseudo prolog notation that I just made up):
      seive(X, 1).
      seive(X, K) :- divides(X, K);
      seive(X, K-1).

      type(prime, X) :- seive(X, X-1).
      Which (barring any errors I made since my prolog is rusty), I believe says that a prime number is anything that isn't divisible by anything less than itself other than one (very inefficient, yes I know). It then says that prime is the type of numbers that pass the seive.

      So, the claim is that Qi's type system can accept something like this and generate meaningful type checking from it. I am uncertain whether Haskell's type system can do this (although I wouldn't necessarily rule it out, since someone has implemented type checking for properly balancing AVL trees in Haskell, which seems mind boggling to me :)).

      In other words, in Qi you seem to be able to specify types via rules, and have them apply to whatever is appropriate, whereas in Haskell you define type classes, and then specifically show how types fit into those classes (although Haskell allows you to define type classes polymorphically, which lets you apply classes to an infinite number of types). The main difference seems to be the ability to use normal functions in type declarations.
      --

      I've come for the woman, and your head.

    106. Re:This is not a troll, but a query... by cstacy · · Score: 1
      He confused quote with backquote and supplied multiple arguments rather than providing a single list of arguments, but
      He used the syntax foo(...) rather than (foo ...), which is a fundamental confusion of the syntax. He also didn't understand the syntax for creating a list, or that the function he called wanted a single object as its argument. Your suggestion that he confused quote and backquote is probably true. (However, either quote or backquote could be used in exactly the same way as each other, to construct the list that he should have written. Apparently you don't know about backquote, either.)

      cadr(`yes `no `maybe)
      My observation that he got all the syntax wrong, but his confusion really seems more extensive than that. He did, however, seem to understand that you can pick out the second element of a list with the CADR function.

      My "What's that supposed to mean?" remark was intended to point out that his joke about Lisp being practical (the punchline being "NO"), was coming from someone who doesn't know how to program in Lisp at all.

      I suppose if someone doesn't know anything about Lisp and is unwilling to learn (perhaps by reading the book being reviewed here) then programming in Lisp would indeed be impractical. So I guess his message was self-consistently true.

      (cadr '(yes no maybe)) is the same as (car (cdr '(yes no maybe))). You can also use things cddr, caddr
      You don't need to try to lecture me about Lisp basics. I know that you can compose CAR and CDR combinations in Lisp. I've been programming in Lisp for a very long time (longer than most people reading this have been alive). But no good programmer, in about the last couple of decades, would tend to write those combinations in order to pick out the second element of a list. CAR and CDR are for emphasizing that you are manipulating individual cons cells (eg. nodes in a tree).

      Instead, to show that you are selecting an element from a linear list, one would write (second '(yes no maybe)). And of course, with respect to the question at hand, that would be wrong.

    107. Re:This is not a troll, but a query... by OOGG_THE_CAVEMAN · · Score: 1

      OOGG wish suggest reason for changing program in running image.

      OOGG surprised you not recognize nature of modern program: typical case is ecommerce type application: running process contain much business data and transactions in progress. World not stop so that program be changed, recompiled, dump current state to disk, kill old binary, launch new binary, read current state from disk, allow users access again.

      Instead, non-stone-age program in Lisp can be changed by redefining rules in running program. Present new views by providing new functions acting on live data. Upgrade functionality by loading new code without losing data and state. Allow users to customize behavior of program by creating new code interactively.

      World not static. Practical program should also not be static.

    108. Re:This is not a troll, but a query... by master_p · · Score: 1

      I'm not saying that you need to redefine stuff in a running image, but if you ever do, Lisp can do that, too.

      But you presented it as one of the main advantages of LISP, i.e. as something that is so important as to be the only criterion for choosing that language.

      why does the Smalltalk syntax "just not make any sense"?

      Because it's stupid and ugly and does not care for human-machine interface principles?

      Smalltalk isn't slow, either. Maybe some implementations are.

      Well, since some implementations are very slow, it seems the language is not easy to optimize for. After all, it has got a 20 year head start from Java!

      Java was slow for a long time too (arguably still is)

      Java is not slow. It's a little slower than C++, but so little that it's almost unnoticable. C++ is faster mainly because of the direct interfacing with C and host O/S. JNI calls are slow.

      I was saying that C dialects seem stuck in the '70s.

      How come is it a bad thing? LISP is stuck in the 50s, and UNIX is stuck in the 70s. Yet I don't see any complaints about that. Just because it's old, it does not mean it's bad.

      The (lack of) success of a language doesn't prove anything, by the way.

      The success or failure of a language proves that the language designers know what they are doing. LISP has one great idea, the free-form syntax, and anything else sucks. Even 'car' and 'cdr' are the register names of the first LISP machines!

      Or do you think that Java is the best language around

      Yes, Java is currently the best programming language. It is easy to grasp, it runs everywhere, it has a powerful gui, it has very good tools, it's fast, it has APIs for anything one wants. Java has got almost everything right. C++ comes up second due to the sheer number of tricks that can be done with templates.

      By the way, I can do with Java/C++ the exact same thing I can do with LISP: I can write a program that accepts an input and produces another program as output. It does not matter if it is compiled or interpreted. What matters is that I can be just as productive with Java/C++ as with LISP using macros.

    109. Re:This is not a troll, but a query... by master_p · · Score: 1

      typical case is ecommerce type application

      It's funny you mention that: Java excels in that particular type of application.

      World not stop so that program be changed, recompiled, dump current state to disk, kill old binary, launch new binary, read current state from disk, allow users access again.

      Thanks for demonstrating your ignorance in developing e-commerce Java applications. With J2EE and a modern app server, Java web apps do not need to be stopped. They run as is, and new code is served on the next requiest. The previous code runs as is, until the session is closed.

      Present new views by providing new functions acting on live data.

      Handling new views at run-time is very easy with Java, too. You just have to make a new view, then run Hibernate. It's all handled automatically by scripts/Java tools.

      Allow users to customize behavior of program by creating new code interactively.

      Java can do that too. Java can also invoke the compiler from inside a Java program, or provide the bytecode to the VM according to the input!

    110. Re:This is not a troll, but a query... by Ulrich+Hobelmann · · Score: 1
      So Smalltalk doesn't care for human-machine interface principles, but Java, "the best programming language", of course, does...

      So you think that [obj keyword: param1 keyword: param2] is stupid and ugly. Well, that's your opinion. I don't want to tell you here how stupid and ugly I think your mom is, because that wouldn't be appropriate.

      Let's just say, that I prefer one of the following two code samples:
      [airplane fly: somewhere atSpeed: ([hashTable get: key] * 3 + 2)]

      Integer i = (Integer) hashTable.get(key);
      airplane.fly(somewhere, i.intValue() * 3 + 2);
      If you nest expressions it's even nicer:
      [foo bla: [bar bla: [quux bla: 42] blarp: 5] blub: 13]

      foo.bla(bar.bla(quux.bla(42), 5), 13);
      Let's not argue about speed here, since most languages (Lisp and Java anyway) are fast enough for most applications.

      Lisp isn't stuck in the '50s. It was invented AFAIK end of the '50s, evolved over more than two decades, in the form of different dialects, was then in 1984 merged into Common Lisp (with all the good and important features), got the first ANSI-standardized object system.

      Lisp contains features from the '80s. Java's most advanced features are probably exception handling, object orientation, and garbage collection. The latter one *originated* in Lisp, and OO was implemented almost as in Java in Smalltalk 20 years before. I don't know about exceptions, but AFAIK '84 Lisp also can do that (I'm still somewhat new to the Lisp world).

      It's funny that you say that everthing about Lisp except the syntax sucks: so object orientation is bad? A uniform data representation that is basically compressed XML is bad? Packages are bad? Keyword arguments are worse than Java's function overloading? Macros are bad? LOOP and FORMAT are bad? Do you even remotely know what you're talking about?

      Sure, CAR and CDR derive from Lisp machine register names. So what? You can combine then to CADAR and CDDR, for instance. You can use FIRST and REST, if you prefer.

      So Java is "the best programming language". Cool. Only that I don't think it's easy to grasp for computer newbies, which I happened to tutor. Java is unnecessarily complicated with its public static final stuff. All the ().[],;{} distract from what you actually want the program to do and makes nested expressions look dead ugly.

      It has good APIs, but that's about all. You have to typecast everything out of containers, which defeats the purpose of static checking. Even cooler are boxing and unboxing of ints to Integers, so you can actually put them in Hashtables. Sure, this all changes in Java 5, but Java had these problems for 10 years! I'm not alone in saying that Java gets almost nothing right. *I* prefer coding in C, because I'm more productive there (less errors, less time spent debugging, better debugging facilities).

      And that you can do macro stuff in Java: I doubt it! Can you easily integrate a yacc-parser in your Java program? How about alternative control structures, loops? C++ templates are unreadable and don't remotely match Lisp macros in power and elegance.
    111. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0
      That kind of smug comment is more likely to put people off LISP. I mean, yes Eric, I'm sure fetchmail is a lot better for the fact that you once dabbled in LISP, but don't go all Godel Escher Bach on us.

      Don't forget ncurses. The man's accomplishments are legion.

    112. Re:This is not a troll, but a query... by Gorbag · · Score: 1
      Well, since everyone else has taken a crack at this; I've used Lisp for pretty much all my software development needs since 1982...

      1) Macros. But the real insight on macros is you are programming the compiler/interpreter itself. You really are extending the language. This means you can change the programming paradigm. PCL (Portable Common Loops) and Flavors brought Smalltalk type programming and then a new way to think about OOP to Lisp. Agent0 brought agent oriented programming to Lisp. Screamer brought nondeterministic programming to Lisp. Defun (how you define a function) is a macro. You can change it. Try doing that in another language, as easily.

      2) Embedded languages. You have control over the readtable, so you can redefine tokens, the parser, everything. You really can easily transform Lisp into something else if you need to, syntax and all, and all through using the lisp READ function.

      3) Flexibility. There are lots of ways to do almost anything and everything - but these different approaches are easier to express in Lisp. I do AI/Cognitive Systems research. Most of the time when I start developing software, I don't know the right approach. Lisp makes it easy to explore the boundaries, figure out what's the right thing to represent, and even let me push new paradigms for investigation. In Lisp, first you develop the programming language you need to solve the problem, and then you solve the problem in that. The language doesn't get in the way.

      Good luck,

      --
      -- I speak only for myself
    113. Re:This is not a troll, but a query... by Anonymous Coward · · Score: 0

      http://www.nemerle.org/ is a functional language featuring macros. Actually, a good part of the language itself is defined as macros (if, for, while, some SQL stuff, etc.).

    114. Re:This is not a troll, but a query... by KenR · · Score: 1

      Really? Which functional language has macros?

      Objective Caml via Camlp4

      Which functional language lets you redefine stuff in a running image?

      Objective Caml using the bytecode intepreter.

  5. Lisp...Piss..Lispiss by Anonymous Coward · · Score: 0

    Subject says it all.

  6. "Practical lisp" is an oxymoron by Anonymous Coward · · Score: 1, Insightful

    Sorry, had to be said.

    1. Re:"Practical lisp" is an oxymoron by omigod!kenny · · Score: 1

      That is your counterargument to a five hundred page book of programming examples carefully selected as exemplars of typical real-world programming? Thank god you posted anonymously. (Someone had to say it.)

  7. Lisp Scheme by superpulpsicle · · Score: 4, Funny

    Lisp is essentially the same as scheme. It's the hardest language to write for IMHO just cause it's out of ordinary.

    There was a story of a hacker stole one of the A.I code from the government. The code turned out to be the last 100 pages of the program. It was all closing paranthesis. That should sum up how nasty the language is.

    1. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      That would be total bullshit - it is exactly analogous to a C++ program with 100 pages of } at the end. Doesn't happen, does it? Doesn't in CL either.

    2. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      It's not that hard to get a huge batch of ) at the end of a LISP expression. I've gotten 10-14 with just very simple code. It's not hard to believe that you could get a huge list. Maybe 100 pages is pushing it, but you could get a lot.

    3. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      It's not hard because it's out of the ordinary. It's hard because the syntax is not human-friendly.

      Sure you get used to it, but I can get used to having a needle in my arm all the time too. That doesn't mean I want to do it.

    4. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      That story is a famous joke about LISP. See http://www.netfunny.com/rhf/jokes/90q2/lispcode.ht ml for the actual joke.

    5. Re:Lisp Scheme by joto · · Score: 1
      Lisp is essentially the same as scheme.

      Lisp is to scheme, as ,uhmm..., C++ is to Pascal. Apart from the parenthesis-heavy syntax, they have very little in common.

      It's the hardest language to write for IMHO just cause it's out of ordinary.

      Well, then you haven't looked very far. The hardest language language to write for is probably Malbolge.

      But there are plenty of more mainstream languages that are harder to write for than lisp. As a matter of fact, most mainstream languages are harder to write for than lisp. It just doesn't seem that way to you, because you grew up using different languages, and have not been interested enough to put at least some effort into learning it.

      So while lisp seems hard to you, it's certainly not particulary hard for e.g. someone who doesn't already know how to program in some other language.

      There was a story of a hacker stole one of the A.I code from the government. The code turned out to be the last 100 pages of the program. It was all closing paranthesis. That should sum up how nasty the language is.

      First, what makes you think this story is true. I hereby present the following story as true, there once was a hacker that stole another A.I code from the government. The code turned out to be the last 100 pages of the program. It was all closing braces. That should sum up how nasty C is.

      Secondly, bad code can be written in any language. Just like the code at the International Obfuscated C Code Contest sums up how nasty C is.

      (PS: I like both C and Lisp! And a lot of other languages...)

    6. Re:Lisp Scheme by cstacy · · Score: 1

      Of course, it's not a true story.

    7. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      The hardest programming language is the Brainfuck. Check it out at: http://en.wikipedia.org/wiki/Brainfuck

      Enjoy.

    8. Re:Lisp Scheme by Unknown+Lamer · · Score: 1

      To get 100 pages worth you'd have to go...[opens oowriter]...in 12 pt font on letter sized paper...5237 [one page worth because I'm not insane] * 100 = 523700 levels of nesting.

      Which would never happen. Even a page of parens is an obscene level of nesting. 10-14 isn't too bad, once you learn to balance parens in your sleep (eventually it happens, trust me). Until then, emacs balances them for you.

      --

      HAL 7000, fewer features than the HAL 9000, but just as homicidal!
    9. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      If you read the parent post you probably noticed something strange about the tone. But if you've never had anything to do with Lisp you won't have recognised it for what it was. This page may help.

    10. Re:Lisp Scheme by Phs2501 · · Score: 1
      10-14 [levels of nesting] isn't too bad, once you learn to balance parens in your sleep (eventually it happens, trust me).

      Ever lisper I know, myself included, just looks at the indentation after hitting the "slime-reindent-defun" key in Emacs. The parens are largely there for the language and the editor, not me.

      (I also use the balanced sexp editing functions in Emacs, so there are rarely unmatched parens lying about.)

    11. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      Lisp is to scheme, as ,uhmm..., C++ is to Pascal

      Let's be accurate. Common LISP is to Scheme as C++ is to, perhaps, C - both dialects of the same basic language, but one far more feature-rich that the other.

      LISP is to Scheme as BASIC is to Microsoft BASIC. One is a dialect of the other.

      Scheme has tons in common with Common LISP.

    12. Re:Lisp Scheme by joto · · Score: 2, Informative
      Let's be accurate. Common LISP is to Scheme as C++ is to, perhaps, C - both dialects of the same basic language, but one far more feature-rich that the other

      No. This is false. And it doesn't really matter that you or many other people believe it to be true. It's still false.

      Scheme is a block-structured language modeled on Algol. Common Lisp is a natural evolution of LISP 1.5. As part of the evolution, sure, some features from Scheme have been sneaked back into Common Lisp, but they are really very different languages.

      LISP is to Scheme as BASIC is to Microsoft BASIC. One is a dialect of the other.

      No, it isn't. Scheme and Common Lisp are no more dialects than Pascal or C++ is. And I really mean what I say. C++ is an evolution of C, which itself is an evolution of B. Something similar can be said of Common Lisp.

      Pascal is an ivory-tower language written to prove a point, that later, with various extensions, almost got useful, and were actually used for real programming. Something similar can be said of Scheme.

      And they are certainly not dialects. They are far too different.

      Scheme has tons in common with Common LISP.

      Pascal also has tons in common with C++. I.e. they are both block-structured imperative languages.

      Sure Scheme has tons in common with Common Lisp. But there are also tons of differences, and many of these differences are important! Such as scheme being block-structered, and Common Lisp not being block-structured.

      If you try to look a bit further than superficial syntactic issues, you will find that the languages are quite different.

      It's the same story as with Java and Javascript. People without a clue believe them to be similar. People with a clue know they aren't.

    13. Re:Lisp Scheme by joto · · Score: 1
      The hardest programming language is the Brainfuck. Check it out at: http://en.wikipedia.org/wiki/Brainfuck

      Huh, brainfuck? It's even nicer than most assemblers I know. If you wan't to talk difficult, you've got to do better than that... Did you even look at the link I provided for Malbolge...

      Enjoy.

      Old hat...

    14. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      Please give concrete examples of the differences between Scheme and Lisp from a technical standpoint. And please explain what you mean when you say "Scheme is block structured."

      Here are differences I know exist:

      1. Scheme has one namespace for all variables, Common Lisp has several (functions, variables, property lists, macros, etc.)

      2. Scheme lacks most of Common Lisp's standard library features.

      3. Scheme lacks special variables.

      4. Common Lisp lacks a few interesting Scheme features, such as continuations.

      That's about it. I think that Common Lisp and Scheme are really only fundamentally different in their communities.

    15. Re:Lisp Scheme by rsheridan6 · · Score: 2, Insightful
      It's not C-influenced-language programmer friendly. If you learn Lisp before you're indoctrinated into Algol-descended languages, the opposite is true - the syntax of those languages is too complicated and annoying, with too many things to remember (like 10 levels of operator precedence).

      It seems difficult to you for the same reason Japanese seems difficult to native English speakers, and English seems difficult to native Japanese speakers.

      --
      Don't drop the soap, Tommy!
    16. Re:Lisp Scheme by noahm · · Score: 1
      Scheme is a block-structured language modeled on Algol. Common Lisp is a natural evolution of LISP 1.5. As part of the evolution, sure, some features from Scheme have been sneaked back into Common Lisp, but they are really very different languages.

      You better tell that to the guys who wrote the scheme spec (R5RS). They certainly seem to think that Scheme is a dialect of Lisp. To quote from R5RS:

      Scheme is a statically scoped and properly tail-recursive dialect of the Lisp programming language invented by Guy Lewis Steele Jr. and Gerald Jay Sussman.

      Scheme and Common Lisp are both dialects of Lisp. They're not the same language, but if you grok one, you can pretty easily figure out the other.

      noah

    17. Re:Lisp Scheme by Ulrich+Hobelmann · · Score: 1

      You think Lisp and Scheme are out of ordinary??

      What about Haskell, Forth, Self?

      Or are you just rambling about all the parentheses?

      I strongly suggest you go look at a *real* Lisp program, such as the examples in the discussed book.

    18. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      Lisp syntax is not programmer-friendly? You know, when Lisp was first invented, it was intended to have a more Algol-influenced syntax (google for "M-expression"), but that idea just died out because programmers liked the s-expression syntax better. The fact is, it's far *more* programmer-friendly than alternate syntaxes!

    19. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      Off topic, but: as a native English speaker, I have to disagree. Japanese is a very easy language (if you have a good memory for vocabulary -- it's grammatically easy, anyway). I can understand native Japanese speakers have trouble with English, but English is a hard language (even for native speakers).

    20. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      Thank you. Exactly what I wanted to say!

    21. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      So maybe Sussman and GLS believe that; doesn't mean they're right. Scheme really is an entirely different language. Scheme source code is text that needs to be parsed, just like C or Pascal or Python or whatever. Lisp source code is structured objects. E.g., the behaviour of 'quote' is different because of that. I think the structure of the source code could be said to be the defining characteristic of a Lisp. And Scheme doesn't have it.

    22. Re:Lisp Scheme by thisgooroo · · Score: 1
      Scheme source code is text that needs to be parsed, just like C or Pascal or Python or whatever. Lisp source code is structured objects.

      i would argue that that is just a difference in how the language specs are written up. if you have a closer look at the BNF, you will notice that it is a textual representation of s-expressions, so the parser should be pretty much identical to the lisp reader (ok, scheme doesn't have read tables and reader macros)

      E.g., the behaviour of 'quote' is different because of that.

      are you sure? i haven't noticed any differences yet

    23. Re:Lisp Scheme by AshPattern · · Score: 1

      Either the story is apocryphal or the government needs better programmers. I suspect the former. That situation just doesn't happen in real life.

      Lisp isn't the same as scheme at all, except for the surface syntax. They're very different languages once you get past the parens.

    24. Re:Lisp Scheme by joto · · Score: 1
      You wrote: You better tell that to the guys who wrote the scheme spec (R5RS). They certainly seem to think that Scheme is a dialect of Lisp. To quote from R5RS:

      Scheme is a statically scoped and properly tail-recursive dialect of the Lisp programming language invented by Guy Lewis Steele Jr. and Gerald Jay Sussman.

      Ok then. But obviously you already know what they mean because you also say:

      Scheme and Common Lisp are both dialects of Lisp. They're not the same language, but if you grok one, you can pretty easily figure out the other.

      Which is true, of course. For some reason, all languages using lots of silly parens are "lisp dialects", no matter how different they are. And for some other reason we don't call all languages with infix syntax Fortran-dialects.

      And if you can read some scheme (or common lisp), you can probably read some common lisp (or scheme) too. (Just as with Pascal and C++). But be aware: the semantic gap between how things are typically done in each of those languages, is huge.

    25. Re:Lisp Scheme by Anonymous Coward · · Score: 0

      R5RS says: (quote <datum>) evaluates to <datum>. <datum> may be any external representation of a Scheme object. (emphasis mine) The implication is that it "copies" its argument (i.e., the argument is part of the stream-of-bytes textual (external representation) source code, not an object per se) In Lisp, quote returns the exact object that actually occurs as its argument in the source.

    26. Re:Lisp Scheme by cstacy · · Score: 1
      There is no definition of what "Lisp" is. When people try to come up with one, it seems to defy any useful non-vague definition. If you look to the heritage of Common Lisp and Scheme, they were both developed by the same community, and they have some similarities. But Scheme comes from a radical faction of the community, and eschews many of the fundamental characteristics of previous Lisps; Common Lisp mostly just refines those older characteristics.

      One big hint that a language is not Lisp is when it calls itself something other than "Lisp". Scheme deliberately self-identifies as something different. That doesn't mean that they aren't related, though.

      I would call Scheme a dialect of Lisp, but it's also fair to argue that it is "not Lisp". It is perhaps as closely (or even more closely) related to Algol, than to its predecessor Lisp dialects. (This is even hinted at by the homage that Scheme's defining "report" document is patterned after the Algol report.) Whether statements about Scheme being Lisp or not are "true" is entirely a religous matter. Scheme and Common Lisp really are very different - the fundamental ideas and techniques used to write programs are quite different. Aside from the parenthesis syntax, and the availability of a built-in linked-list data type, they have very little in common. The languages are used by different kinds of people with different ways of thinking and diametrically opposed aesthetics and priorities. The languages were created for entirely different purposes. Proponents of each language like to claim that theirs is "Lisp", and they are naturally upset when the other side tries to sell you a different religion with the same name as theirs. And that's the only reason that it "matters" what "Lisp" is.

      (That's just my opinion. I've been programming almost exlusively in Lisp for the past 25 years, and was part of the hacker community at MIT where these languages originated.)

    27. Re:Lisp Scheme by cstacy · · Score: 1
      Scheme and Common Lisp are both dialects of Lisp. They're not the same language, but if you grok one, you can pretty easily figure out the other.
      Not quite. People who have been taught Scheme are almost universally baffled when they encounter Common Lisp. (Part of this bafflement is because certain fundamental ideas are so different, and yet the languages both have parenthesis, and they were told that they had been taught "Lisp".) I have less experience with people going in the other direction (Common Lisp to Scheme), but I would expect some similar confusion, if they were not forewarned.
  8. *hyper-cliki*? by Anonymous Coward · · Score: 0

    Good grief.

    1. Re:*hyper-cliki*? by Anonymous Coward · · Score: 0

      Hahahahaha I have to agree, that's about the worst so far.

  9. Non-procedural programming by SpaceAdmiral · · Score: 1

    I think my favorite university course was a course focusing on "non-procedural programming." The course was half-Lisp and half-Prolog. Sure, I haven't ever actually used anything I learned in that course. But it was neat. Everytime I write code that involves parsing a text file, I always complain "I wish I were allowed to do this in Lisp." Webprogramming in Lisp would be, um, interesting. . . I've never considered that possibility before. I might buy the book just for help setting that up.

    1. Re:Non-procedural programming by Anonymous Coward · · Score: 0

      The Yahoo Store system was originally written in Lisp. There's a great mini-history about that, although I don't know where it is.

    2. Re:Non-procedural programming by Fitzghon · · Score: 1

      VIAWEB is the company you are thinking about. They wrote software for creating online stores online. They coded in Lisp. Check out http://paulgraham.com/ for more information. Fitzghon

    3. Re:Non-procedural programming by Frank+Buss · · Score: 1

      There are some information at Paul Graham's site: http://www.paulgraham.com/avg.html and a more technical description: http://lib.store.yahoo.com/lib/paulgraham/bbnexcer pts.txt

    4. Re:Non-procedural programming by sketerpot · · Score: 1

      I've been doing web programming in Lisp recently. I've been using UnCommonWeb, which is a continuation-based web programming framework, and Yaclml, a library for HTML generation. Also the CLSQL database interface library adds some syntax for building SQL queries, which simplifies things and makes SQL injection attacks impossible. I've got to say, it's loads of fun.

    5. Re:Non-procedural programming by Anonymous Coward · · Score: 0

      if you want to do web programming you have to absolutley try UnCommonWeb http://common-lisp.net/project/ucw/, it's really cool and programmed by a friend of mine ;)

  10. Damn Lisp.... by ShyGuy91284 · · Score: 0

    I've got a lisp!!! It's not though..... Sry, couldn't resist........ Someone else would have done it if I didn't.....

    --
    In undeveloped countries, the consumer controls the market. In capitalist America, the market controls you.
  11. Review - Mistake by stevey · · Score: 1

    At one point you used 'for for' when you probably only meant to use one for!

    Still I'll look forward to checking this book out, in the past I've done a lot of Emacs Lisp hacking but very little stand-alone lisp work, and now seems like as good a time as any to get more involved.

    Once I got to grips with the way lisp programming worked it felt very natural and very powerful.

    1. Re:Review - Mistake by Ulrich+Hobelmann · · Score: 1

      By all means do. Compared to Emacs Lisp (hehe) Common Lisp is much more powerful.

  12. practical? common? by daraf · · Score: 5, Funny

    (if (or (= lisp practical) (= lisp common)) (monkeys-fly-out 'my-ass) (life-as-normal))

    1. Re:practical? common? by UnknowingFool · · Score: 4, Funny
      (if (or (= lisp practical) (= lisp common)) (monkeys-fly-out 'my-ass) (life-as-normal))

      I don't know what is sadder: the fact that you wrote it, or the fact that I understand what you wrote.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    2. Re:practical? common? by Anonymous Coward · · Score: 0

      Isn't "Practical LISP" an oxymoron?

    3. Re:practical? common? by Anonymous Coward · · Score: 1, Funny

      I think the saddest thing is the way the monkeys-fly-out function takes a symbol to modify its behaviour. That's terrible design. I'd prefer a my-ass object.

    4. Re:practical? common? by imsabbel · · Score: 1

      Can you help be a bit about the syntax?
      It ALMOST makes sense if read as inverse polnic from right to left...

      --
      HI O WISE PRINCE. WHT TOOK U SO DAM LONG?
    5. Re:practical? common? by tayhimself · · Score: 1

      Think of it like an RPN calculator. The arguments follow the function. STart from the deepest nested function and walk outwards.

    6. Re:practical? common? by stormcoder · · Score: 1

      Wouldn't that be a reverse RPN calculator. RPN calculators have the arguments come first and then the function.

      --
      Sorry my bullshit sensor overloaded.
    7. Re:practical? common? by tayhimself · · Score: 1

      Yeah, youre right.

    8. Re:practical? common? by glwtta · · Score: 1
      Wouldn't that be a reverse RPN calculator.

      Wouldn't that be 'PN'?

      --
      sic transit gloria mundi
    9. Re:practical? common? by Anonymous Coward · · Score: 0

      I think you mean equal, not =

    10. Re:practical? common? by sketerpot · · Score: 1
      That's not good Lisp code at all! Try this:

      (if (or (practicalp lisp) (commonp lisp)) (monkeys-fly-out 'my-ass) (life-as-normal))

      Also, we'll want to define those two functions:

      (defun practicalp (x) (eql x lisp))
      (defun commonp (x) (not (eql x lisp)))

    11. Re:practical? common? by Anonymous Coward · · Score: 0


      (if (or
      (eql lisp practical)
      (eql lisp common))
      (monkeys-fly-out 'my-ass)
      (life-as-normal))



      HTH

    12. Re:practical? common? by Anonymous Coward · · Score: 0

      Right, the practical and common way is:

      <xsl:case>
      <xsl:when test="{$xsl}='extensible' or {$xsl}='stylish'">
      <xsl:call-template name="monkeys-fly-out">
      <xsl:param name="from-where">you-know-what</xsl:param>
      </xsl:call-template>
      <xsl:otherwise>
      life-sucks
      </xsl:otherwise>
      </xsl:case>
      </code>

      And don't have me how you the jsp taglib version.

    13. Re:practical? common? by Anonymous Coward · · Score: 0

      Your ass must be hurting! :)

  13. Re:Good book, questionable language. by tenordave · · Score: 2, Informative

    Where the hell have you been? It has better exception handling than most langauges (including java, read the book), and was one of the first languages to use garbage collection. In addition, you'll find all the normal data structures in all the other languages, threading, and so on that you're used to. CL of today is not CL of the past.

    --
    http://students.washington.edu/djwatson
  14. Re:Good book, questionable language. by Anonymous Coward · · Score: 0

    Not that it's the same, but I currently am working with MIT Scheme, which has full garbage collection.

  15. Dylan - pretty Lispy by aCapitalist · · Score: 2, Interesting

    Dylan

    seemed to have many of the benefits of Lisp without the prefix notation - macros, CLOS-based object system, multi-methods, multiple returns, optional type declarations, named parameters (I think), etc...

    Dylan was started by Apple Research Cambridge in the late 80s, but was laid to rest (at least for Apple) after Jobs came back and the NeXT infusion.

    At least Functional Objects opened up their stack and is now being incorporated by the above URL guys.

    1. Re:Dylan - pretty Lispy by The+Muffin+Man · · Score: 1

      Dylan wasn't successful exactly because it didn't have Lisp's regular parentheses notation. This might sound strange if you don't know Lisp but once you've grokked what's so cool about it you'll realize that you actually need and want the syntax as it is now.

    2. Re:Dylan - pretty Lispy by aCapitalist · · Score: 1

      The funny thing about your comment is that one of th reasons that Lisp was never successful was because of the prefix notation. It's just not natural.

      With Dylan, you got 90%+ of the power of Lisp without the funky notation.

    3. Re:Dylan - pretty Lispy by Tayssir+John+Gabbour · · Score: 1

      Emacs was successful though, and it doesn't hide its use of parens. And XML/HTML is hugely successful, and it has sharp parens everywhere, which happen to be a lot less readable than Lisp because of end-tags.

      Perhaps the unusual syntax does have an effect, but easy availability is far more dominant.

    4. Re:Dylan - pretty Lispy by hey! · · Score: 1

      There's nothing intrinsically less natural about prefix notation than infix notation -- it's arguably more natural, since you don't need the conventions of operator precedence.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    5. Re:Dylan - pretty Lispy by frank_adrian314159 · · Score: 1
      the prefix notation. It's just not natural.

      So lemme get this straight - a bunch of engineers who probably cream themselves when some story about an HP-48 lookalike comes out because it talks postfix are gonna bitch about prefix notation?

      --
      That is all.
    6. Re:Dylan - pretty Lispy by e40 · · Score: 1

      Without all those parens you would not have the power of macros. It is precisely because program and data are the same, you can even have such a powerful macro system.

      Your comment is just the same uninformed crap people have been spouting about Lisp for decades.

    7. Re:Dylan - pretty Lispy by aCapitalist · · Score: 1

      The funny thing about all 4 of these replies is that only 1 even commented on Lisp not being successful, and that one brought up Emacs - which uses elisp for parts of it.

    8. Re:Dylan - pretty Lispy by Anonymous Coward · · Score: 0

      Dylan originally had Lispy syntax (it was implemented in Lisp, even). I think it would have been more successful if it had kept the Lispy syntax.

    9. Re:Dylan - pretty Lispy by Anonymous Coward · · Score: 0

      Durrrrr Dylan has macros.

    10. Re:Dylan - pretty Lispy by e40 · · Score: 1

      Yeah, lots of languages have macros. C has them. That doesn't mean they are anything like Lisp macros. In languages other than Lisp they are text substitution. In Lisp, macros manipulate program data to construct new program data.

  16. Re:Good book, questionable language. by hqm · · Score: 1
    It is new enough to contain features such as strong typing and lexically-scoped parameters that programmers today rely upon to implement OOP and RAII techniques, but programs are made unnecessarily complex by the lack of exceptions and garbage collection -- available in the most current crop of languages (C#, Java).

    You are very confused. CommonLisp most certainly has exceptions, and generally speaking the implementations have much better GC than any Java you will come across.

    Sheesh.

  17. C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 2, Informative

    Lately there has been a lot of LISP hype mostly thanks to Paul Graham. I keep hearing "Macros are amazing", "totally different way of thinking about programming".

    That's great and all but I can't find any concrete examples. I want to see a list of problems that are either difficult or nearly impossible with Java/C++ and see LISP's implementation.

    Can anyone help me to get past the hype?

    1. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 0

      Yeah, "totally different way of thinking about programming"... Translation: it's hard for humans to manage.

      LISP sucks.

    2. Re:C++/Java/LISP Side by Side Comparison? by cduffy · · Score: 1

      Mmm. Once upon a time I wrote a test harness and framework for some Java code I was working on using one of the Java Scheme implementations. The individual tests were 80% one-liners -- far simpler, shorter and cleaner than would have been possible otherwise -- mostly owing to the lack of extra/unnecessary split between data and code.

      Sure, the same code could have been written in Java (using reflection) or Python (using its language-native introspection) -- C++ is right out, having no runtime introspection capabilities -- but it was shorter, simpler and cleaner in Scheme.

      Unfortunetly, the lack of a consistant (across implementations) and expansive runtime library makes scheme next to useless for a lot of practical purposes. *sigh*.

    3. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 0

      Translation: it's hard for stupid fucking morons like you to manage. Go back to your VB.NET.

    4. Re:C++/Java/LISP Side by Side Comparison? by Tayssir+John+Gabbour · · Score: 1
      Lately there has been a lot of LISP hype mostly thanks to Paul Graham. I keep hearing "Macros are amazing", "totally different way of thinking about programming".

      That's great and all but I can't find any concrete examples. I want to see a list of problems that are either difficult or nearly impossible with Java/C++ and see LISP's implementation.

      Can anyone help me to get past the hype?

      Good question, I agree Paul never explained macros in his essays. And he doesn't mention the pitfalls of using it too much; I think paradigms shouldn't be like some actor hogging the stage away from the rest of his ensemble.

      The uses range from a complete sublanguage, to warping the language a bit for safety's sake. An example of a minor warping is "with-open-file", which closes a file automatically at its end. In fact, the whole class of "with-" macros is to nicely clean up any resource you might want to use. Minor warpings get rid of repetitive boilerplate code, which just clutter things up and make it less maintainable.

      Another example is "loop". Ever notice that a for(;;) loop can be expressed as a do() loop with some syntactic sugar? Well, in Lisp you can make your own for(;;) loops, instead of waiting for some language designer.

      As we go deeper into macrology, we find there are many domains which your language designer knows nothing about, and neither does 99% of the language's users. But those domains may be expressed very well with a special syntax.

      And the end, you have crazy code walkers and full-blown languages which sit atop Lisp. Qi is one of them, which claims to be "the most powerful type system of any existing functional language". Lisp itself isn't so fancy and functional, but Qi is.

      Also, there's an HTML language, which enables you to not worry about closing tags. It does use parentheses to "close" things, but it's still lighterweight and easier to read.

    5. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 2, Informative

      Here's one:

      Add a construct to your language called "with_open_file" that takes three arguments: a filename, a variable name, and a block of code. The construct should open the file, store the open file handle in the variable, and then run the block of code with that variable in its scope. After the code completes or has an exception, the file should be safely closed. Example:

      with_open_file("/tmp/flozz", f) {
      f.write("Hello, world\n");
      if (rand() > 0.5)
      throw Exception;
      }

      Yes I know how to do exception handling and so forth in Java/C++ but I want you to add a *new keyword* to your language.

      Another one:

      We're working on a timing-sensitive project. I need to you to add another keyword to your language. This one is called "sleep_between" and should take an integer argument N and a block of code. It should insert "sleep(N)" statements between each statement of the code and then run it. For extra credit, create a general keyword that inserts ANY block of code between the statements of another block of code, and use that to implement "sleep_between". Example:

      sleep_between(1) {
      print("3");
      print("2");
      print("1");
      print("contact");
      }

      Extra credit: modify your code so that it also inserts the sleep() calls at the end of every *loop* within the block. So if I rewrote my example to say "for n = 3 downto 1 print(n)", it would still sleep between each statement.

      Another one:

      The junior programmer didn't know about the "with_open_file" statement. His code keeps throwing exceptions and leaving data unsaved. We're shipping tomorrow and we need to have this fixed this afternoon. Write a function that runs his code and rewrites it on the fly to use our safe "with_open_file" keyword. (In Lisp this is *easier* than just doing a search and replace, btw).

    6. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 0

      C++ does have introspection. It's called RTTI.

    7. Re:C++/Java/LISP Side by Side Comparison? by Tayssir+John+Gabbour · · Score: 1

      Also, Lisp does have "goto"; but in my experience it's always just building material for a macro. So you don't see it; there's just the goto underneath.

    8. Re:C++/Java/LISP Side by Side Comparison? by hey! · · Score: 2, Interesting

      Simple. Macros turn the simple but boring work of solving a programming problem into the difficult and interesting work of extending the language you are working in.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    9. Re:C++/Java/LISP Side by Side Comparison? by qui_tollis · · Score: 1

      In PCL an example is given of a unit testing framework. Excluding comments, the code for this comes to around 30 lines, which I think is a little shorter than JUnit. This is not some toy utility, I have recently started working on a commercial lisp app and use this testing framework daily.

    10. Re:C++/Java/LISP Side by Side Comparison? by sketerpot · · Score: 1

      You could check out the book being reviewed. It's very clear, and it's online for free.

    11. Re:C++/Java/LISP Side by Side Comparison? by sketerpot · · Score: 1
      Unfortunetly, the lack of a consistant (across implementations) and expansive runtime library makes scheme next to useless for a lot of practical purposes. *sigh*.

      Have you tried PLT Scheme? I've heard good things about it, and it may be what you're looking for.

    12. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 0

      No. Because it only starts to matter when the code gets large. There are no 5 line (or even 500 line) examples where the difference will really be obvious to you. Looking at small bits of code will only serve to convince you that "there's nothing to see here, move right along"

    13. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 0

      Except with-open-file isn't a keyword in lisp, so that restriction is completely useless.

    14. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 0

      "Write a function that runs his code and rewrites it on the fly to use our safe "with_open_file" keyword. (In Lisp this is *easier* than just doing a search and replace, btw). "

      How is code that re-writes other code on the fly supposed to be maintainable in any way? What you describe sounds like a maintenance nightmare.

    15. Re:C++/Java/LISP Side by Side Comparison? by Anonymous Coward · · Score: 0

      You do realize that "code that rewrites other code on the fly" is describing a compiler, right? Do you have some maintainability problem with compiled languages? Or with compilers?

  18. Practicle Common Lisp???!!! by mestreBimba · · Score: 1

    Now there's an oxymoron if I ever saw one!

    --
    Fly Fish? Participate in our forum
    1. Re:Practicle Common Lisp???!!! by ari_j · · Score: 2, Funny

      People who can't spell "practical" can't be expected to appreciate the finer things in life.

    2. Re:Practicle Common Lisp???!!! by mestreBimba · · Score: 1

      My spelling is poor.... that is why I code, instead of writing the next great American novel.

      Self modifying, recursive, spaghetti code I can do without..... but I have written a chunk of it.

      --
      Fly Fish? Participate in our forum
    3. Re:Practicle Common Lisp???!!! by ari_j · · Score: 2, Insightful

      Your assumption that all self-modifying and/or recursive code is spaghetti code belies the fact that you've never actually learned Lisp.

      I have always found that spelling and grammar skills are very important to good coding, as well. After all, it helps immensely to be able to spell your variable names correctly. Even if you spell them incorrectly consistently, someone else who is looking for the bugs in your code will probably decide that one of the bugs is your spelling, and will break more things than he fixes, particularly if you used the correct spelling for another variable.

    4. Re:Practicle Common Lisp???!!! by mestreBimba · · Score: 1

      That is why I name all my variables; foo, goo, boo, or such. :)

      --
      Fly Fish? Participate in our forum
    5. Re:Practicle Common Lisp???!!! by ari_j · · Score: 1

      I have personally been bit in the ass very hard by my variable names being too similar. I don't accuse anyone of being an idiot unless it's something I've done myself. ;)

    6. Re:Practicle Common Lisp???!!! by Anonymous Coward · · Score: 0

      Your assumption that all self-modifying and/or recursive code is spaghetti code belies the fact that you've never actually learned Lisp.

      LOL. If you actually take the time to look up "belies" you'll see that this statement actually agrees with the OP. I love it when an abrasive post backfires. Your lexical fascism is no match for my semantic fascism. "Belies" means "turns into a lie". What you're saying is, I don't believe you've never learned LISP, based on the fact that you assume that all self-modifying and/or recursive code is spaghetti.

      Which entirely agrees with my experience after learning and using LISP in a team environment for 2 years.

      So we're all agreed, then. LISP code is a fucking mess :)

    7. Re:Practicle Common Lisp???!!! by Tayssir+John+Gabbour · · Score: 1
      So we're all agreed, then. LISP code is a fucking mess :)
      I think it can be, if people haven't invested in some skill. For example, an ideal VCR should be much easier to program than Python. (Well, they usually don't get that part right, but VCRs should be easier.) If you had to use Python to program a VCR, people would have some really messed up VCRs.

      But I think Lisp definitely rewards skill, as well as requires it. It's not a deskilling tech.

    8. Re:Practicle Common Lisp???!!! by ari_j · · Score: 1

      No, "belies" also means "disguises." I should have said his "assertion" rather than "assumption" does this, but the meaning is the same: he is covering up the fact that he's never actually learned it.

    9. Re:Practicle Common Lisp???!!! by Anonymous Coward · · Score: 0

      Your sentence still doesn't make sense. Why not just admit you no speaka English? There's no shame in that. Unless, of course, it's your native language.

    10. Re:Practicle Common Lisp???!!! by ari_j · · Score: 1

      If it doesn't make sense, then you're the one with a language deficiency. Of course, I admit who I am, you anonymous chickenshit.

    11. Re:Practicle Common Lisp???!!! by Anonymous Coward · · Score: 0

      What's your point? Lisp code is never self-modifying, rarely recursive, and no more prone to being spaghetti than code in any other language.

  19. O'Reilly: Are you listening? by Glomek · · Score: 2, Interesting

    There IS a place for modern Lisp books!

    1. Re:O'Reilly: Are you listening? by Fahrenheit+450 · · Score: 1

      O'Reilly doesn't give a shit anymore. It's been ages since they cared about promoting things that were technologically interesting. All they do anymore is find what's popular and crank out 100 volumes of crap on the same subjects every other publisher is churning out titles for.

      Meh... I guess they have to make money somehow though...

      --
      -30-
    2. Re:O'Reilly: Are you listening? by stesch · · Score: 1
      I'm glad "Practical Common Lisp" wasn't published by O'Reilly. It would have cost the same, but with a softcover instead of the hardcover.

      Apress made a really nice book you can put into the better part of your bookshelf.

  20. Re:Good book, questionable language. by diaphanous · · Score: 1

    but programs are made unnecessarily complex by the lack of exceptions and garbage collection -- available in the most current crop of languages (C#, Java).

    What are you talking about? Common Lisp has both exceptions (conditions) and garbage collection.

  21. If you think Lisp is impractical... by Anonymous Coward · · Score: 1, Interesting

    Common Lisp is more concise, more expressive and MUCH FASTER than Perl, Python, PHP, Ruby and all those other "scripting" languages. It also has better reflection, exception handling and object orientation than Java or C#. I see no reason to use those languages over Lisp, really. Does anybody who know CL actually prefer one of those languages? Note: taking a course in college does not make you "know" a language.

    1. Re:If you think Lisp is impractical... by Anonymous Coward · · Score: 1
      Yes, because we all know how easy it is to create a standalone executable in CL which replaces all occurances of 'foo' with 'bar' in a set of files...
      #!/usr/bin/perl -p -i

      s/foo/bar/g
    2. Re:If you think Lisp is impractical... by nicholasharbour · · Score: 1

      A decent gui toolkit that doesn't cost $5000 a seat would help me use CL more. Other than that, great language.

      --

      Nearly half of all people are below average
    3. Re:If you think Lisp is impractical... by The+Muffin+Man · · Score: 1

      LispWorks has a wonderful cross-platform GUI toolkit (Windows, Linux, OS X, several Unix versions) and costs US$ 1,100 per seat, not US$ 5,000.

    4. Re:If you think Lisp is impractical... by adoarns · · Score: 1

      They're working on it.

      --
      Tenemus pyrobolos atqui jacimus cognitiones.
    5. Re:If you think Lisp is impractical... by Anonymous Coward · · Score: 0

      that's a script, not a standalone executable.

    6. Re:If you think Lisp is impractical... by Anonymous Coward · · Score: 0

      It's not much harder in Lisp. But if replacing "foo" with "bar" in a bunch of files is the extent of your need for a programming language, by all means stick with Perl.

    7. Re:If you think Lisp is impractical... by Anonymous Coward · · Score: 0

      While the Lisp syntax is more uniform and than those languages, I wouldn't say that it's more concise. Macros do make it more expressive, but a lot of constructs are fairly verbose.

    8. Re:If you think Lisp is impractical... by OOGG_THE_CAVEMAN · · Score: 1

      OOGG confused by your post. You mention "standalone executable"

      However, your post has perl script which is neither standalone nor executable. Instead, requires Perl installation, and is interpreted.

  22. hrm by comet69 · · Score: 0

    indeed... lisp is a very powerful language, but practical is not what I'd use to describe it whatsoever.. i've seen it do wonders with clustering projects in which manipulate AI tasks.. that is if you're one of those crazy Patmos'ers

    --
    - Hi I'm Linus Torvalds and I pronounce Linux, Lih-nix..
  23. ... programming paradigms by grumpyman · · Score: 4, Funny

    When I think of functional (lisp), my head's twisted and then unwinded. When I think of contraint-based (prolog), my head feels like upside-down. When I think of object-oriented, I think of org-chart. When I think of procedural, I think of spagetti.

    1. Re:... programming paradigms by terpri · · Score: 0

      I know this was a joke, but actually, Common Lisp is a multiparadigmatic language. It has far better support for functional programming than mainstream languages, but that's just due to its very general nature, and pure functional programming is not as easy in CL as in, say, Haskell. CL has good support for imperative-style programming - it even has GOTO! CL was the first standardized object-oriented programming languages, with the Common Lisp Object System (predating C++ by a few years). Logic programming is not built into CL, but through macros, very extensive support for logic programming may be implemented (Prolog-in-Lisp is not too difficult, for instance). So, if you're going to shoot yourself in the foot, CL is like the gun store that will let you shoot yourself in the foot any damn way you want. ;-)

    2. Re:... programming paradigms by refactored · · Score: 1

      postscript forth joy or or think? about arse head

    3. Re:... programming paradigms by Anonymous Coward · · Score: 0

      pure functional programming is not as easy in CL as in, say, Haskell.

      Huh? Common LISP evolved from LISP, which is a pure functional language. All you do is restrict yourself to the pure functional subset and you're doing pure functional programming.

      Prolog-in-Lisp is not too difficult

      Prolog-in-Lisp is an academic exercise designed to impress students. A PROLOG compiler is 99% optimizer. Prolog-in-Lisp embeds an unoptimized constraint solver and then interprets it. There are 4 or 5 orders of magnitude speed difference, which is the difference between a tool and a toy. LISP does not "encompass" PROLOG in anything but a set theoretic sense.

    4. Re:... programming paradigms by sketerpot · · Score: 1

      Lisp isn't functional. It can do functional things, but it can also be used naturally to write procedural and object-oriented code. And sometimes prolog-style code. And sometimes ML-style pattern-matching code. And sometimes code in other styles that you don't hear about very often.

    5. Re:... programming paradigms by Anonymous Coward · · Score: 0

      prolog isn't constraint based. It is true that gnu prolog has a constraint solver in it but that doesn't make prolog a constraint based language.

    6. Re:... programming paradigms by Anonymous Coward · · Score: 0

      Actually you can do all of these in Common Lisp. CL doesn't impose a paradigm on you: you can program in CL and use different paradigms for different projects.

    7. Re:... programming paradigms by Anonymous Coward · · Score: 0

      Pure functional languages don't allow functions to modify their parameters or the execution environment. Lisp does permit these things.

      The primary advantage of pure functional languages is that it's easier to prove that a program is correct. However it's often convenient to break away from this approach and Lisp allows you to do this without impeding your ability to write a program in a style mimicing a purely functional language.

    8. Re:... programming paradigms by Anonymous Coward · · Score: 0

      Lisp is generally considered to be a functional language but not a pure functional language.

    9. Re:... programming paradigms by rsheridan6 · · Score: 1

      I have no personal experience with it, but the Prolog embedded in the latest Allegro Common Lisp is supposed to be pretty fast (like not-a-toy fast). This is new within the last year or so.

      --
      Don't drop the soap, Tommy!
    10. Re:... programming paradigms by Anonymous Coward · · Score: 0

      Lisp (*please* note the spelling: "Lisp", not "LISP") is *NOT* a functional language.

    11. Re:... programming paradigms by Anonymous Coward · · Score: 0

      Lisp is "generally considered" to be a lot of things that it isn't, by people who don't know any better. Slow, interpreted, only for AI, etc.

      Among Lispers, it's not considered to be a functional language.

  24. Re:My first exposure to list ( and a mirror of boo by ajs · · Score: 3, Informative

    If you find LISP interesting, Haskell might also be of interest.

    Recent interest in Haskell has exploded because of the implementation of Pugs in GHC. Pugs is a compiler / interpreter prototype for Perl 6, which is also a functional language, borrowing many concepts from LISP and smalltalk (as well as just about every other popular research or practical programming language).

  25. Learn Lisp Without Installing Anything on Your PC by smug_lisp_weenie · · Score: 3, Interesting

    I have a tutorial available that teaches lisp in comic-book form. It is geared to quickly ramp up a newbie to some very advanced lisp tool very quickly.

    It uses a free online telnet lisp that lets you try Lisp with zero install required.

  26. I Prefer the Elisp Implementation by Greyfox · · Score: 1
    Elisp feels very much like java to me -- everything appears to get passed by reference and you can use goops if you want objects. Guile and other variants don't behave the same way, which can catch you by surprise if you started out writing useful little utilities for Emacs. Elisp makes a lot of sense but it's not good at threading and stuff like that which other variants of lisp do have to one degree or another (Guile's threading seems to be pretty good though I haven't done a whole lot with it.)

    My biggest gripe with LISP is that there are so many fragmented implementations that if you're looking for an app that does something cool (Like dynamic web page generation) it typically won't be in the variant of Lisp that you're currently using. Every time I look at Lisp, I always end up impressed with how elegant and easy it is to use. Then I start actually trying to do stuff with it and run up against the fragmentation problem and the lack of standard libraries. At least Guile addresses the library issue -- there's a whole bunch of guile code available these days.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    1. Re:I Prefer the Elisp Implementation by Ulrich+Hobelmann · · Score: 1

      Emacs Lisp uses dynamic scoping, which is the Wrong Thing. Scheme and Common Lisp are more modern and cleaned this up.

      Guile is one Scheme implementation. There are many more. The book discussed here is about Common Lisp, which is much more powerful than Scheme, Emacs Lisp, Java or most other languages.

      Common Lisp isn't too fragmented (unlike Scheme, which I suppose you mean). It was standardized in 1984, the first ANSI standard with an object system (that's way more powerful than Java, btw).

      Both Lisp and Scheme have some libraries, but Lisp tends to have more of them. You might want to take a look at the book!

    2. Re:I Prefer the Elisp Implementation by sketerpot · · Score: 1
      The big problem with elisp is that it doesn't have lexical scoping, which can be very inconvenient sometimes.

      It would help if you thought of Common Lisp and Scheme as different languages. Then you could go and download Lisp in a Box and get started off right with Common Lisp, which has a lot of cool stuff written for it. Yes, I'm biased. :-)

    3. Re:I Prefer the Elisp Implementation by Anonymous Coward · · Score: 0
      Elisp feels very much like java to me -- everything appears to get passed by reference
      You appear to be confused. In Emacs Lisp, just as in all Lisps dating back into the 1950s, everything is in fact passed by value!
    4. Re:I Prefer the Elisp Implementation by jlandahl · · Score: 1

      My biggest gripe with LISP is that there are so many fragmented implementations that if you're looking for an app that does something cool (Like dynamic web page generation) it typically won't be in the variant of Lisp that you're currently using.

      While this does happen in areas which are not treated by the Common Lisp standard (notably network programming and concurrency), it really isn't the problem you make it out to be.

      Here's just a handful of code libraries and frameworks for Common Lisp and the implementations they support:

      • Araneida, an extensible web server and webapp framework: SBCL, CMUCL, OpenMCL, ABCL, CLISP, AllegroCL, LispWorks
      • UnCommonWeb, a continuations-based web application framework: OpenMCL, CMUCL, SBCL, CLISP, AllegroCL
      • CL-SQL, a powerful database library: AllegroCL, LispWorks, SBCL, CMUCL, OpenMCL
      • McCLIM, a free implementation of the CLIM user interface library: AllegroCL, CMUCL, SBCL, OpenMCL, LispWorks, CLISP
      • Cells-GTK, a GTK library built on top of Cells, for declarative UI development (a very powerful approach): AllegroCL, LispWorks, CMUCL, CLISP
      • CL-PPCRE, a fast Perl-compatible regular expression library (which is faster than Perl's regexp engine, incidentally): AllegroCL, CLISP, CMUCL, Corman Lisp, ECL, MCL, OpenMCL, SBCL, SCL, LispWorks, Genera
      • XMLisp, a very interesting intersection of XML and CLOS objects: MCL, LispWorks, OpenMCL, SBCL, CLISP
      • ACL-COMPAT , a library with socket programming support (et. al.): CLISP, CMUCL, Corman Lisp, LispWorks, MCL, OpenMCL, SBCL, SCL
  27. Re:Learn Lisp Without Installing Anything on Your by smug_lisp_weenie · · Score: 3, Informative

    Oops- Here's the link: tutorial

  28. Well, search Paul Graham's site for examples... by PaulBu · · Score: 1

    ... You will even find a book there. Try expressing some of of his macros as C++ with templates ;-)

    (I doubt one can express a lisp macro in C/C++ WITHOUT templates, YMMV).

    Paul B.

  29. Ha Ha! by DoasFu · · Score: 1

    Sissy European lisp thingy!

    1. Re:Ha Ha! by Anonymous Coward · · Score: 0

      Followup reference:

      Ha Ha!

      Bi-curious.

  30. Best Lisp Book: On Lisp by ari_j · · Score: 5, Informative

    Paul Graham's book, On Lisp, is the single best book on programming I have ever read. You can get it as a PDF from his website, for free.

    You will also want to read his essay, Revenge of the Nerds, for some serious insight into why Lisp is just so darn good.

    If you're just starting on Lisp, the best place to start is with GNU CLISP, although you will find yourself wanting to use Emacs with SLIME to interact with your Common Lisp environment. I use SBCL, but CMUCL and CLISP are also acceptable. On my Powerbook, I use SLIME with OpenMCL.

    1. Re:Best Lisp Book: On Lisp by Phs2501 · · Score: 2, Interesting
      On Lisp is certainly a good book about one particular feature of Common Lisp (macros), but it's not a good introduction to the language.

      Frankly, I find both Seibel's Practical Common Lisp and Norvig's Paradigms of Artificial Intelligence Programming to be much better books on Common Lisp than anything Graham has written. Seibel has excellent practical examples dealing with current technologies, and Norvig's examples cover a very interesting subject matter not usually used when teaching a language.

    2. Re:Best Lisp Book: On Lisp by ari_j · · Score: 1

      Sorry, I didn't mean to say it's a good introduction to the language. You need to know Lisp first, but if you know it then On Lisp is, as I said (at least from my subjective standpoint), the best book on programming I've ever read.

      Lisp in Small Pieces is on my list for the next time I have time for that kind of reading. This week it's Constitutional Law in a Nutshell. ;)

    3. Re:Best Lisp Book: On Lisp by Anonymous Coward · · Score: 0

      the single best book on programming I have ever read

      I take it you read it recently. It has a lot of charm, and I can see how you'd think it was the best book ever if you bought into everything he said. But a few years playing with those ideas doesn't necessarily bring you to the same conclusions, and when you choose to abandon LISP in favour of, say, static type checking, his insistence that all great hackers prefer LISP, and if you don't prefer LISP you aren't a great hacker, begins to grate somewhat.

    4. Re:Best Lisp Book: On Lisp by Anonymous Coward · · Score: 0

      If On Lisp is the best programming book you have ever read, you have never read SICP .

    5. Re:Best Lisp Book: On Lisp by Anonymous Coward · · Score: 0

      Although Paul Graham's book is an excellent resource for 'advanced' LISP, two texts I would recommend for someone interested in understanding why there is still so much passion aroused whenever this language comes up (and particularly those who wish to 'get it') are:

      'The Little Lisper' -- one of the most interesting texts for teaching a computer language (written in the style of a catechism)

      And, of course, the good old SICP ('Structure and Interpretation of Computer Languages') -- which teaches not about LISP (or Scheme), but about what it is to be a programmer (forming and manipulating abstracations).

      Happy reading.

    6. Re:Best Lisp Book: On Lisp by ari_j · · Score: 1

      Nope, years ago. Good try, though. There's nothing that I learned in any programming book that comes close to what I learned from On Lisp (with the possible exception of a GW-BASIC book I started programming with in the first place). Maybe it's just the preexisting experience I had with the topics of other books before reading them, but I didn't really find anything earth-shattering in other books. (Not that On Lisp was really that earth-shattering, but it at least showed me things I hadn't seen before.)

    7. Re:Best Lisp Book: On Lisp by ari_j · · Score: 1

      You are technically correct ("the best kind of correct"), and I will have to read that one sometime. Thanks for the pointer. (It looks a little bit "Welcome to Computer Science 373: Basic Compilers", but I'll check it out anyhow.)

    8. Re:Best Lisp Book: On Lisp by Fahrenheit+450 · · Score: 1

      Or CTM.

      --
      -30-
    9. Re:Best Lisp Book: On Lisp by Anonymous Coward · · Score: 0

      Yes, it is an intro CS book. Nonetheless, it does an amazingly good job of capturing the spirit of computer science and of Scheme/Lisp, and has all kinds of interesting little examples.

    10. Re:Best Lisp Book: On Lisp by Tayssir+John+Gabbour · · Score: 1

      I'm not a fan of SICP, but you may enjoy the video lectures.

      My issue with SICP is it doesn't teach things like errorhandling or macros, and is very recursion-heavy. But others enjoy it, so YMMV.

    11. Re:Best Lisp Book: On Lisp by The+boojum · · Score: 2, Insightful

      when you choose to abandon LISP in favour of, say, static type checking, his insistence that all great hackers prefer LISP, and if you don't prefer LISP you aren't a great hacker, begins to grate somewhat.

      Yes, that's my biggest problem with his writings. I rather like static type checking personally, and will gladly trade the minor benefit in malleabillity for more error checking at compile time. I can't count the times I've made a trivial typo in Perl, for example, taken hours to find it and then thought to myself, "this would have been caught instantly in ML."

      While LISP is a cool language, I really like what I've seen of the strongly static-typed functional languages like the ML family (especially OCaml.) I love the pattern matching features for example. The only thing I miss in them is the macro mechanism from LISP or Scheme and the extreme performance optimizations of modern C++ compilers. I do heavy-duty numerical coding in C++ (graphics/ray tracing), but I'd love to be able to write code in a statically-typed functional language, have macros expand out and optimize or inline the low-level, performance critical parts and have the compiler optimizer work it over till it's as fast as I'd be able to do in C++. (or faster!)

      So yes, I consider myself a pretty good code-hacker, but I'd still not pick LISP for my graphics code. LISP is not the right tool for every job.

    12. Re:Best Lisp Book: On Lisp by Tayssir+John+Gabbour · · Score: 2, Informative
      While LISP is a cool language, I really like what I've seen of the strongly static-typed functional languages like the ML family (especially OCaml.) I love the pattern matching features for example. The only thing I miss in them is the macro mechanism from LISP
      Qi (which is built on Common Lisp) is touted as having "the most powerful type system of any existing functional language, including ML and Haskell." Perhaps you may wish to try it out and see.
    13. Re:Best Lisp Book: On Lisp by Anonymous Coward · · Score: 0
      Paul Graham [paulgraham.com]'s book, On Lisp [paulgraham.com], is the single best book on programming I have ever read.


      Then you need to read more. I suggest PAIP. On Lisp is the single best book on Common Lisp macros. But programming? That's an overstatement.
    14. Re:Best Lisp Book: On Lisp by Anonymous Coward · · Score: 0


      Yes, that's my biggest problem with his writings. I rather like static type checking personally, and will gladly trade the minor benefit in malleabillity for more error checking at compile time. I can't count the times I've made a trivial typo in Perl, for example, taken hours to find it and then thought to myself, "this would have been caught instantly in ML."


      This had been exactly my experience as well. But then there were times when I would just hit a wall with OCaml. These times are very infrequent but the problems are much more fundamental. These days, Lisp is my language of choice (even though it isn't perfect)

  31. Re:LISP is amazing. (really?) by Merdalors · · Score: 1

    'car' and 'cdr' are supposed to be references to machine registers in some prehistoric implementations of LISP.
    ("Lots of Infuriating Single Parentheses").

    --
    Slashdot entertains. Windows pays the mortgage.
  32. This article has truly inspired me by Anonymous Coward · · Score: 4, Funny

    To wonder why there isn't a -99 "Suicidally Boring" option when you're moderating...

    1. Re:This article has truly inspired me by Anonymous Coward · · Score: 0

      I wonder that too when I read all of your posts.

  33. Tcl/Tk RULES!!! by js7a · · Score: 1
    Tcl captures the Lisp-nature without retaining the assembly-nature, the parentheses-everywhere-nature, and the wow-is-it-still-the-1950s-nature.

    I predict this comment lasts 12 minutes before being modded down to -1. WHY DO THE MODERATORS HATE AMERICA?

    1. Re:Tcl/Tk RULES!!! by nizo · · Score: 2, Insightful

      I swear I would rather chop off my left hand then program in Tcl ever again. But I won't hold your love of Tcl against you :-) My favorite behaviour when using Tcl was seeing a syntax error in code that had been running in production for years. Since Tcl isn't preprocessed god only knew how many syntax errors where in that code. Granted the programmer should have written test cases to exercise all of the code, but that is a whole other ball of stupidity.

    2. Re:Tcl/Tk RULES!!! by js7a · · Score: 3, Funny
      Delayed compilation is a feature!

      Which would you rather have, a syntax error where indicating the code is faulty, or a silent semantics error?

      Although (ahem) uh, the possibility of the former doesn't preclude the latter, but, uh, please observe the authoratative manner in which I wave my hands!

    3. Re:Tcl/Tk RULES!!! by Anonymous Coward · · Score: 0

      the parentheses-everywhere-nature

      Yeah, you have braces and brackets everywhere.

      expr, anyone?

    4. Re:Tcl/Tk RULES!!! by jonnystiph · · Score: 1

      I swear I would rather chop off my left hand then program in Tcl ever again.

      I have seen and faced the horrors of Perl/Tk and I would say the same of Tk. Perhaps it was a shoddy implentation, but I just think the whole language is bug ridden and crap. Perhaps a case of the workman blaming the tool, either way crappy tool, throw it out.

      --

      If we don't make light of everything, we are just stumbling in the dark - Blank

    5. Re:Tcl/Tk RULES!!! by Anonymous Coward · · Score: 0

      "I swear I would rather chop off my left hand then program in Tcl ever again."

      You're either a liar or insane. I hate Visual BASIC with a vengence, but if I had a choice between losing my left hand (or even the tip of the pinky finger of my left hand) and having to program using Visual BASIC, I would choose to program using Visual BASIC. I think that any rational person would make the same choice.

      People who claim that they would trade body parts for almost any reason (e.g., "I would give my right arm to have sex with the Olsen twins.") are almost always lying or just totally insane. The only exception that I can think of in recent times is that guy who got his arm trapped under a boulder out in the desert, and cut it off to prevent his death. And he just did it; he didn't claim in advance that he would do it.

      Please don't trivialize the sacrifices made by people who have actually lost body parts for good reasons.

    6. Re:Tcl/Tk RULES!!! by bill_mcgonigle · · Score: 1
      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    7. Re:Tcl/Tk RULES!!! by OOGG_THE_CAVEMAN · · Score: 3, Insightful

      Tcl however lack the "robust abstraction" nature of Lisp. Instead, has "everything a string" nature.

      Personally, OOGG feel any language where "value of variable" needs $ notation is severely brain-damaged. Absolute opposite of abstraction.

    8. Re:Tcl/Tk RULES!!! by js7a · · Score: 1

      Firstly, my neolithic friend, only people with your prehistoric perspective see cadadaring into lists as abstract-anything. Hmpf! Furthermore, Tcl has had object scintilation and real honest-to-god numeric types for any string that happens to be treated as if they were one, since somthing like v7.1. Sure it took a while. But good things come to those who wait.

    9. Re:Tcl/Tk RULES!!! by OOGG_THE_CAVEMAN · · Score: 1

      Existence of true numeric types, however, not change essential nature of Tcl evaluation: substitution of strings for symbols prefixed by $. Result is usual shell-language nightmare of quoting with various "strength", "uplevel". Lisp take approach of virtually every other programming language: names represent values of variables, except in assignment and definitions.

      OOGG never use cadadar or similar accessors in use of Common Lisp. For structured data, OOGG prefer structures or objects, with well-defined accessor methods. When OOGG mention abstraction, he mean functional and macro abstraction.

    10. Re:Tcl/Tk RULES!!! by js7a · · Score: 1
      Perhaps if you'd let go of that woman you're dragging around by the hair over which all the other cavemen are clubbing you in the head, you might recognize the inherent simplicity and power of the eleven rules of Tcl syntax.

      Hard and soft quoting exists in lisp as well, with the choice of apostrophe or backquote.

      You should never actually need to use uplevel, but it will allow you to do almost anything you could want to do with a lisp macro. Frankly, I've never met a macro of more than a couple or three lines that I didn't hate, because of the fact that they make understanding the code using more dificult than outrunning a woolly mammoth in heat.

  34. Common Lisp and Schem are really different. by notany · · Score: 5, Funny

    Comon Lisp and Scheme are as different as programming languages can be.

    Scheme can be said to be ontological attack against Lisp. It looks Lisp but is as far from Lispiness as you can and being still Lisplike.

    Schemer: "Buddha is small, clean, and serious."
    Lispnik: "Buddha is big, has hairy armpits, and laughs."
    -- Nikodemus

    Greenspun's Tenth Rule of Programming:
    "Any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp."

    Common Lisp people seem to behave in a way that is akin to the Borg: they study the various new things that people do with interest and then find that it was eminently doable in Common Lisp all along and that they can use these new techniques if they think they need them.
    -- Erik Nagggum

    More than anything else, I think it is the ability of Lisp programs to manipulate Lisp expressions that sets Lisp apart. And so no one who has not written a lot of macros is really in a position to compare Lisp to other languages. When I hear people complain about Lisp's parentheses, it sounds to my ears like someone saying:

    "I tried one of those bananas, which you say are so delicious.
    The white part was ok, but the yellow part was very tough and tasted awful."
    -- Paul Graham

    Lisp is about rising above implementation to saying something of lasting
    value. -- Kent Pitman

    Pascal is for building pyramids -- imposing, breathtaking, static structures
    built by armies pushing heavy blocks into place. Lisp is for building
    organisms -- imposing, breathtaking, dynamic structures built by squads
    fitting fluctuating myriads of simpler organisms into place.
    - Alan J. Perils

    Puns are pricey to have in the language becuase they lead to ambiguity
    but they are also a source of great expressional power, so we live
    withthem. People who don't like them should probably seek out Scheme,
    which tends to eschew puns, for better or worse.
    -- Kent M Pitman @ comp.lang.lisp

    Q: How can you tell when you've reached Lisp Enlightenment?
    A: The parentheses disappear.
    LISP has survived for 21 years because it is an approximate local
    optimum in the space of programming languages.
    -- John McCarthy (1980)

    ``Lisp has jokingly been called "the most intelligent way to misuse a
    computer". I think that description is a great compliment because it
    transmits the full flavor of liberation: it has assisted a number of our
    most gifted fellow humans in thinking previously impossible thoughts.''
    -- "The Humble Programmer", E. Dijkstra, CACM, vol. 15, n. 10, 1972

    Lisp is like a ball of mud--you can throw anything you want into it, and
    it's still Lisp".

    Java was, as Gosling says in the first Java white paper,
    designed for average programmers. It's a perfectly
    legitimate goal to design a language for average
    programmers. (Or for that matter for small children, like
    Logo.) But is is also a legitimate, and very different, goal
    to design a language for good programmers.
    -- Paul Graham

    > The continuing holier-than-thou attitude the average lisp programmer...

    There are no average Lisp programmers. We are the Priesthood. Offerings
    of incense or cash will do.

    -- Kenny Tilton at c.l.l

    Dalinian: Lisp. Java. Which one sounds sexier?
    RevAaron: Definitely Lisp. Lisp conjures up images of hippy coders,
    drugs, sex, and rock & roll. Late nights at Berkeley, coding in Lisp
    fueled by LSD. Java evokes a vision of a stereotypical nerd, with no
    life or social skills.

    In the Algol family, parentehses
    signal pain. In the Lisp family, they signal comfort. Since most people are
    highly emotional believers, even programmers, it is very hard for them to
    relinquish their beliefs in their associations of parentheses with pain and
    suffering. This has nothing to do with aesthetics, design rationales, ease
    of u

    --
    Dyslexics have more fnu.
    1. Re:Common Lisp and Schem are really different. by killjoe · · Score: 1

      Thank you, that was one of the most insightful and funny posts I have ever read on /. Now you are going to make me go learn lisp you bastard.

      --
      evil is as evil does
    2. Re:Common Lisp and Schem are really different. by Anonymous Coward · · Score: 0
      Lisp conjures up images of hippy coders, drugs, sex, and rock & roll. Late nights at Berkeley, coding in Lisp fueled by LSD. Java evokes a vision of a stereotypical nerd, with no life or social skills.
      sex, drugs, rock and roll, and computer programming? what a load. coders are squares, regardless of the language they use.
    3. Re:Common Lisp and Schem are really different. by Anonymous Coward · · Score: 0

      Nah, I still like Perl better.

      You can do everything you can in Lisp. You can treat code as data (source filters make for... interesting... code), you can use the B modules to screw around with your code, and you can terrify any other coder who looks at it all at the same time with something that approximates 'meaningful' line noise.

    4. Re:Common Lisp and Schem are really different. by notany · · Score: 1

      > Nah, I still like Perl better.

      This tells lot about you. You see:
      PERL = Perversion Excused by Random Lispiness.

      Best of you Perl coders are just sadomasochist lispers. Sadist part of you writes the code. Masochist part of you debugs and tries to maintain it. Ooh yes! Whip me. Beat me. Make me maintain Perl code.

      EXTERIOR: DAGOBAH--DAY

      With Yoda strapped to his back, Luke climbs up one of the many thick vines
      that grow in the swamp until he reaches the Dagobah statistics lab.
      Panting heavily, he continues his exercises--grepping, installing new
      packages, logging in as root, and writing replacements for two-year-old
      programs in Lisp.

      YODA: Code! Yes. A programmer's strength flows from code
      maintainability, but beware of Perl. Terse syntax... more than one
      way to do it... default variables. The dark side of code
      maintainability are they. Easily they flow, quick to join you when
      code you write. If once you start down the dark path, forever will
      it dominate your destiny, consume you it will.

      LUKE: Is Perl better than Lisp?

      YODA: No... no... no. Quicker, easier, more seductive.

      LUKE: But how will I know why Lisp is better than Perl?

      YODA: You will know. When your code you try to read six months from now.

      thanks for Lorrie Wood

      --
      Dyslexics have more fnu.
  35. Lisp might be good but.. by glogic · · Score: 2, Funny

    It's a pity, but lets face it: Lisp could never be adpoted for widespread use - there's only a finite number of parenthesis in the universe.

  36. Re:LISP is amazing. (really? -- yes) by jorge-tavares · · Score: 1
    The first Lisp implementation on IBM 704: CAR (Contents of Address Register) and CDR (Contents of Data Register).

    Oh, and by the way: Lisp Is Simply Perfect.

  37. SICP by Anonymous Coward · · Score: 0

    I think its a bit hardcore to refer to SICP as "basic" computer science. I read it after 10 years of industrial experience and found it an amazing but hard piece of work to get my head around -- constraint programming and a unification engine included with loads of other tough stuff.
    Easily the best computing book I've ever read.

  38. The advantages of functional languages by doc+modulo · · Score: 4, Insightful

    - C++ is more readable than assembler
    - C# and Java are more readable than C++ ...
    - At the end of this list are functional programming languages.

    If you can read source more easily, then maintainability will be better. Most projects maintain code, they write new code less often.

    This article will tell you why you should be interested in functional programming languages (this link is about Lisp). If you're smart and open minded, you will be convinced.

    The best functional languages are Haskell and Erlang (click "next" at the bottom of the page). But like the review and link indicate, there's actual value to learning Lisp.

    However, the book review is much too in-depth and has jargon.

    A simpler example: with Java you prevent bugs by static typing variables, example:

    int numberOfTries = 3;

    If you later try to fill "numberOfTries" with a string, the compiler will warn you of a bug and you'll have prevented it. The Java compiler makes it a rule that you have to give a type to your variable so your code quality will be higher (fewer bugs).

    With Haskell, you don't have to type int. Haskell will figure out the type for you, you get the benefit of preventing bugs with the convenience of not having to type variables. There are other good features like that in functional programming languages.

    You could say that every language puts restrictions on what the programmer can do. I mean writing the source code is bottlenecked by the rules of the language (every variable should have a type. You can't do this/that etc.) so that the resulting code AUTOMATICALLY has fewer bugs. Well the amount of source "laws" in functional languages is much lower than in C++ and Java. This means that there is less to remember for a programmer and there is less chance for rules to conflict/interact with each other (in Java you can't use certain variable types in static classes = another meta rule to remember).

    Besides having less rules to remember and take into consideration. The functional languages have also chosen the best "laws" to follow. I mean that if you follow the source laws of Java, it's still relatively easy to produce buggy programs, with functional languages it's harder to produce implementation bugs (thinking bugs are always possible but that's your problem).

    The only problems with functional programming languages is that the rules which govern source code are very good, but also very different from the rules in traditional programming languages. It might seem like thinking upside down/backwards for people already familiar with procedural languages. Another problem is that because of humans sticking to what they know, the libraries of the functional languages aren't as extensive as those of Java for example. This means that you'll have to program more parts of your program yourself instead of just using a ready made library which fits the task. This problem is limited by the fact that you can program 10 times faster than in Java and, as I said, maintenance takes up most of the time anyway.

    The reason I chose Erlang is because with functional purely functional programming languages like Erlang, you can automatically multitask your program over several CPU's (or this will take minimal effort). Nice feature to have in the future because every CPU manufacturer is going multi-core chip now. The future is in multiprocessor machines, not higher clockspeeds (unless diamond wafers become viable) (Lisp is not purely functional by the way).

    Also, you can easily make a server that never goes down with Erlang because your server is automatically clustered. Just plonk down a couple networked PC's and if one dies, the server cluster will just keep on going (a bit slower) until you replaced the power supply of the broken PC.

    There are tons of other advantages but, as I said,

    --
    - -- Truth addict for life.
    1. Re:The advantages of functional languages by Da+VinMan · · Score: 1

      This article [paulgraham.com] will tell you why you should be interested in functional programming languages (this link is about Lisp). If you're smart and open minded, you will be convinced.

      And if you are smart and open minded, you might just be able to accept that it wouldn't convince a smart and open minded person. For instance: they might already be convinced so, despite the merits of the article, it can not convince them.

      Nice (unintentional?) troll...

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    2. Re:The advantages of functional languages by doc+modulo · · Score: 1

      No problem, that part is mainly for the obstinate people that now have 2 ideas linked.

      If I'm not convinced -> I'm not smart :)

      --
      - -- Truth addict for life.
    3. Re:The advantages of functional languages by mattknox · · Score: 1

      He did not say that the article would convince them, merely that they would be convinced-he doesn't even say when that would be. His statement is therefore consistent with readers commencing reading the article already convinced of the its premise. More interestingly, you seem to be making a fairly strong argument for relativism-if you think that the paper's arguments are unconvincing, that is one thing, but do you believe that there are no statements that are valid litmus-tests? If someone said that the optimal language for getting some string-parsing task done on a Unix box was assembler, I would know that he was either joking or some variety of idiot. Statements like "If you define productivity as the inverse of the amount of time required to implement a given spec, java is not a terribly productive language, averaged over a large number of programmers." are measurable and falsifiable, and the claims of the essay would seem to be similar.

    4. Re:The advantages of functional languages by Da+VinMan · · Score: 1

      He did not say that the article would convince them, merely that they would be convinced-he doesn't even say when that would be.

      I'm not going to waste a lot of time on this, but since we're being picky, it's probably worth noting that he also did not state what the reader ought to be convinced of.

      Also, I'm not a believer in relativism, though it could appear that way based on how I talk and write. I do believe however that everyone's perspective is unique (yes, it's relative) because that perspective is complex as it's constituted by many, many conditions (absolutes). So, no I don't believe in relativism as it's usually understood, but I do believe in 'perspectivism' in that an outsider to another's perspective/context usually does not (and usually can not) have enough information to decide whether a given statement really applies to another individual or group.

      To use your above example: assembler may indeed be the best tool for a given string processing task under Unix given certain conditions (such as - absolutely huge amounts of data to be processed in a complex way where developer productivity doesn't matter, but processing time does; as such as the programmer in question only knows assembler and can get the job done pretty quickly that way and doesn't want to take the time to learn Perl or Tcl). That doesn't mean that it would always be the best choice, but the determination of the best choice is ultimately a locally objective judgement (what most people mean when they say "it's subjective") based on a complex situation.

      Relativism (as most people use it), you can't live with it; and you can't live without it (as I think it ought to be understood).

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    5. Re:The advantages of functional languages by master_p · · Score: 2, Interesting

      Oh man, your post has so many things wrong, I don't know where to start! And I am not trolling, this is serious: dissinformation should be stopped. Read on, please.

      C# and Java are more readable than C++

      C# and Java are not more readable than C++. If I write C++ code without templates, C++ code is 99% similar to C#/Java.

      At the end of this list are functional programming languages

      Functional languages are not more readable than C++/C#/Java. ML is bareable, but a long Haskell/Erlang/O'Caml program is unreadable, no matter how you approach it. Examples: Haskell's operator ++ that has nothing to do with addition? O'caml's '#' for membership? The double ';' at the end of declarations? LISP's 'car', 'cdr' and 'cons' instead of 'head', 'tail' and 'pair'? and the list goes on...

      LISP is not a functional language. It has developed to be one, but it did not start as one. In fact, it has destructive update, i.e. the SETQ operation (if I recall correctly)...

      A simpler example: with Java you prevent bugs by static typing variables, example:

      Having to explicitely declare the type of a variable is not static typing. Static typing is when the types of values are determined at compile-time.

      With Haskell, you don't have to type int. Haskell will figure out the type for you, you get the benefit of preventing bugs with the convenience of not having to type variables. There are other good features like that in functional programming languages.

      Bullshit. Having not to declare the type of a variable is not a primary characteristic of functional languages. The primary characteristic of functional languages is the non-destructive update of the state of the application. There are imperative languages that also have type deduction. And by not declaring types, one makes the program really unreadable, and very difficult for Intellisense editors. In fact, with Intellisense, it's just as easy.

      In fact, the only difference of functional languages with imperative ones are the lack of assignment. All other capabilities of functional languages can also be found in imperative languages. There is nothing of functional languages, except lack of assignment, that can not exist in imperative languages.

      so that the resulting code AUTOMATICALLY has fewer bugs. Well the amount of source "laws" in functional languages is much lower than in C++ and Java. This means that there is less to remember for a programmer and there is less chance for rules to conflict/interact with each other (in Java you can't use certain variable types in static classes = another meta rule to remember).

      The only reason FP programs have fewer bugs is because assignment is not allowed. Other than that, logical bugs creep in in the usual way. All FP languages are not purely functional, and they hide state update in strange places, because otherwise it would be impossible to program. And no functional language has its primary APIs directly in that language! all the serious work (networking, DB, GUI etc) are done from C, C++ and/or Java libraries!

      There are tons of other advantages but, as I said, the above links will convince you if you're smart.

      Bullshit. Functional languages are glorified calculators. I can do with C++ the exact same programming, using operator overloading and list copying. Show me how to sort a 100,000 records recordset with functional programming style and then we can talk.

      It was invented by Ericsson to create ultra reliable realtime servers.

      Well, Linux is programmed in C and it is ultra-reliable. So is Solaris and BSD. And WinNT. And VAX. And MacOS X.

      Functional languages are a waste of time. It's time to have an imperative language with the close-to-the-hardware C mentality, LISP syntax, type deduction etc that also provides facilities for proof-carrying code. That's where the money is. Functional languages are an evolutionary dead-end.

      The reason that I say the

  39. Re:Learn Lisp Without Installing Anything on Your by refactored · · Score: 1

    Well, Ruby doesn't warp your brain the way Lisp tends to, but "Why the Lucky Stiff's" Poignant Comic Book Guide to Ruby definitely will definitely umm, errr, it will, ahh, ahh shucks, see for yourself! Why's (Poignant) Guide to Ruby

  40. Practical Common LISP? by Quattro+Vezina · · Score: 0, Troll

    LISP is as Practical and Common as the Holy Roman Empire was Holy, Roman, and an Empire.

    --
    I support the Center for Consumer Freedom
    1. Re:Practical Common LISP? by the_2nd_coming · · Score: 1

      spoken like a moron who has never used it.

      --



      I am the Alpha and the Omega-3
  41. More than Three: by Anonymous Coward · · Score: 0

    Note: The following are not necessarily unique to Lisp:

    * Anonymous functions (why does a function used only once in your entire program need a name?)

    * Programs that can modify themselves (think A.I. for games, genetic algorithms, etc.)

    * Programs that can be modified at runtime. Think patching a critical program (server, kernel, whatever) without shutting it down.

    * Ability to develop and then test individual functions/modules without writing extra code to do it (Lisp in interactive mode). I.E. write a function to parse input, then test it on the fly by calling the function from an interactive prompt. This is invaluable when you are writing only one part of a larger system.

    * Makes it easier to create good functions/methods.

    * Don't have a language feature you want and no one will build it for you? Write it yourself!

    * Efficient garbage collection.

    * Run in a VM, or compiled.

    * Use OO or functional design.

    Miles Teg

  42. conditions vs call-cc by Anonymous Coward · · Score: 0

    Can you give us a brief overview of how conditions (exceptions) are better-than scheme's call-cc?

  43. Re:My first exposure to list ( and a mirror of boo by behindthewall · · Score: 2, Informative

    FYI, the download-able files contain the book examples' source code. They do not contain the book itself.

  44. Re:Good book, questionable language. by e40 · · Score: 2, Interesting

    As everyone else that's replied to you has pointed out you are talking out your ass. Lisp had exceptions and GC long before Java or C# were even an idea. GC in Common Lisp is far ahead of GC in Java and .Net, for just this reason. An industrial strength GC isn't made over night, it's made by having applications beat the hell out of the GC and the implementors spending huge amounts of time handling huge programs. This is exactly what's happened for Lisp over the last 20 years. For example, Allegro CL hosts industrial applications the likes that have never even been dreamt of in Java or C#--programs that use GBs of memory and runs for months. Try that in Java or C#.

    If you are still unconvinced, Orbitz wouldn't even be possible (according to the authors of the software that run the site) without Common Lisp.

  45. Ugly stepchild syndrome by Anonymous Coward · · Score: 1, Insightful

    CL sufferes from the ugly stepchild syndrome. Its so ugly that the only reason its still around is because it is faster than the nice looking alternative (think scheme). Also compare to ML vs. Haskell, C++ vs. Objective-C, etc.

    1. Re:Ugly stepchild syndrome by Ulrich+Hobelmann · · Score: 1

      What are you trying to say?

      There are fast Scheme implementation too.

      ML and Haskell are totally different languages, just like Lisp and Scheme, or C++ and Objective C.

      In fact O-C is popular, even though it's way slower than C++. It's much more elegant, more readable and more powerful.

    2. Re:Ugly stepchild syndrome by Anonymous Coward · · Score: 0
      Let's break it down in convient table form...
      Ugly | Pretty (but slow)
      -----+-----------
      Lisp | Scheme
      ..ML | Haskell
      .C++ | Objective C
    3. Re:Ugly stepchild syndrome by Ulrich+Hobelmann · · Score: 1

      But ML is much prettier than C dialects. Haskell is slow only because it's lazy (i.e. I'd love a strict Haskell).
      Lisp isn't that ugly, except for its funcall and #' syntax.

      So overall I think ML and Lisp are pretty, too, while Obj-C isn't too pretty, because you have to write too much stuff the C way.

      Well, in the end it's all a matter of personal taste I think.

    4. Re:Ugly stepchild syndrome by Anonymous Coward · · Score: 0
      Lisp isn't that ugly, except for its funcall and #' syntax.
      Common Lisp isn't ugly because of its syntax, its ugly because it has a bazillion special forms, crufty names (like "progn", "cdadar", "setf", etc.), and people tend to write ugly imperative programs with it.
    5. Re:Ugly stepchild syndrome by Anonymous Coward · · Score: 0
      Common Lisp isn't ugly because of its syntax, its ugly because it has a bazillion special forms
      Common Lisp has 24 special forms. 24 is not "a bazillion". Special forms (special operators, in modern parlance) are the primitive syntax of the language -- equivalent to the grammar of other languages. Almost all other languages have more "special operators" than Common Lisp.
  46. Re:Practical Common Lisp???!!! by mestreBimba · · Score: 1

    It has been several years since I last programmed in Lisp. At the time there were few tools that would indicate how/where parenthesis balanced (and no integrated IDEs) making long lisp statements rather cumbersome to parse by hand. Writing Lisp programs in pico brings back some old memories.

    Lisp does do some task rather elegantly, simplifying implementation and coding of some tasks. I still prefer other languages for most tasks.

    --
    Fly Fish? Participate in our forum
  47. LISP is amazing-GeneraOS by Anonymous Coward · · Score: 0
  48. Lisp might be good but..XML by Anonymous Coward · · Score: 1, Insightful

    "It's a pity, but lets face it: Lisp could never be adpoted for widespread use - there's only a finite number of parenthesis in the universe."

    I only have two things to say to that.

    "<" and ">"

    1. Re:Lisp might be good but..XML by cpghost · · Score: 1

      Actually, XSLT looks and acts pretty LISP-ish, with the only difference that, compared to Lisp, it is horrible to read!

      --
      cpghost at Cordula's Web.
  49. Best books are Lisp books by Alcarohtar · · Score: 1

    Have I been reading wrong books, or Lisp books are among the best books ever written about any programming language? I mean, both Graham books, this one and Norvig's Paradigms of AI include some of the best snippets I've ever encountered. Could it be that Lisp is indeed a good language?

    1. Re:Best books are Lisp books by mattknox · · Score: 1

      You should check out Lisp In Small Pieces-amazing book on lisp (and other interpreter) implementations. It is by Christian Quiennec. It should tell people something that so many of the books are that good.

      That said, The Art of Java is pretty good too-it's the only good java book that I know of.

  50. Re:LISP is amazing. (really?) by Anonymous Coward · · Score: 0
    (car (moto (car (moto (moto) car (moto car)) car moto)) car (moto (car moto)))

    (fuck (your grandfather) you (to your mom) (to your grandmother))

  51. Solution: RPL by Urusai · · Score: 0

    Reverse Polish Lisp.

    Yes, it's real, as any HP-48 hacker can tell you.

  52. Flipped through this in Borders the other week by Anonymous Coward · · Score: 0

    I was highly tempted to get it. It made C-Lisp look like a fun language. Now I know it's online, so I might look at it again there....

  53. LISP is a dead language by Anonymous Coward · · Score: 0, Flamebait

    Now that I've your attention, let me tell you what I really think. :-)

    Lisp syntax and style is awesome. I first learned Lisp a couple decades ago and I've never seen a language that is as expressive and *general* as Lisp. Every program I write in Ruby or Perl I think to myself "man, if this were Lisp I could just..." then I sigh and continue banging out code.

    When I saw this book I thought it was pretty cool. Actually, it *is* pretty cool. I bought a copy as soon as the dead tree version was available.

    But Lisp has some serious problems that need to be overcome before you'll see it get popular. Every time I bring them up I get flamed by the smug lisp weenies (SLW). But here goes.

    1) There needs to be only one Lisp implementation. Every time a programmer or a book author suggests Lisp, he gives a *list* of implementations. This is no good. I only want to devote brain cells to exactly one implementation.

    2) This one implementation needs to come with an elegant Lisp-ish standard library, with threads, Unix integration, process handling, web development, etc. Take a look at Ruby: it comes with RSS libraries, a *complete web server*, XML parser, integration with Unix, a thread library..etc.. If your Lisp implementation doesn't *at least* these things "out of the box", you lose (or rather, you continue to lose). Don't flame me and tell me how on Debian, you only had to install X Y Z and W. I'm not going to switch OS just to play with a language that doesn't pay the bills.

    3) Legacy stuff has to GO. ANSI Lisp is chock full of crap. At least remove the deprecated stuff already. Just *remove* car/cdr already (or at least pretend they aren't there). Any terminology that doesn't match Unix, change it. If Unix calls it a file, stream, or process, you do the same. Sad but true.

    4) Package system. asdf or whatever it is sucks. I don't know how to use it. It doesn't work reliably. It doesn't make sense. When I asked I get flamed. When it breaks and I ask what the error message means, I get flamed. When I point out the correct code to do what I want is inelegant and hard to remember, I get flamed. The other day I tried to load a testing framework into CLISP. It gave an obtuse error message. I googled for the error message and the only hit was an IRC chat log where three SLW's were pulverizing a newbie because he dared ask for help. After I gave up, I tried to install SBCL. It segfaulted during install and wouldn't finish (I'm on gentoo). I gave up again and went back to Ruby.

    5) Community. Look at the Ruby community. Friendly, enthusiastic people. The Lisp community is full of bitter old souls (like me, heh).

    There is only one solution to all this: somebody like a Matz or a Guido need to come along and make their own "UniLisp" and break from the ranks. Make a *truly* practical Lisp. Push at the expense of all these other Lisps. Rise to the top. Please, the programming world needs it. Everytime I see somebody doing something in another language that is SOOO easy in Lisp, I cringe. I wish I could tell them to start using Lisp, but I know it's not worth the trouble for 95% of the programmers out there. That's sad, because Lisp is really the ultimate general language.

    1. Re:LISP is a dead language by Anonymous Coward · · Score: 0
      I'll try to answer your questions, but you will be better off asking them over in comp.lang.lisp


      1) There needs to be only one Lisp implementation. Every time a programmer or a book author suggests Lisp, he gives a *list* of implementations. This is no good. I only want to devote brain cells to exactly one implementation.

      Agreed, but we can't pick one Lisp implementation and just tell others to die. It's against the bill of rights! In practice CMUCL is the de facto standard on UNIXes. If on UNIX some lib doesn't work with CMUCL, it ain't worth it. A port of CMUCL to Windows should be available soon.


      2) This one implementation needs to come with an elegant Lisp-ish standard library, with threads, Unix integration, process handling


      These all come with CMUCL (althought perhaps not the other things you mention)


      3) Legacy stuff has to GO. ANSI Lisp is chock full of crap. At least remove the deprecated stuff already. Just *remove* car/cdr already (or at least pretend they aren't there). Any terminology that doesn't match Unix, change it. If Unix calls it a file, stream, or process, you do the same. Sad but true.

      How will you read the best programming book ever written (Paradigms of AI Programming by Norvig) if we rename stuff :-) ? Others will complain.


      4) Package system. asdf or whatever it is sucks.

      I don't use it. It's not part of Common Lisp either. I can't say anything about it. But at first glance it did look overengineered.


      5) Community. Look at the Ruby community. Friendly, enthusiastic people. The Lisp community is full of bitter old souls (like me, heh).

      See below.


      There is only one solution to all this: somebody like a Matz or a Guido need to come along and make their own

      Oh, no! Not the Guido! (He's stupid by our standards)
  54. LIPS IS TEH SUXK0RS by Anonymous Coward · · Score: 0

    HAHAH PRACTICAL COMMON LISP ISN"T that a oxymoron??!??! haha it's neither practical nor common. I learned Lisp and I don't like it.

    ---
    A simulated slashdot user.

  55. That's not what car and cdr are for... by jtdubs · · Score: 4, Informative

    That's probably not the right way to think about it. A cons cell is a data structure that holds a pair of items. The first is the car; the second is the cdr. The accessors for those parts of a cons cell also have the names car and cdr.

    Linked lists are just one data structure that you can implement with cons cells. You can also implement a stack, queue, binary-tree, association-list, etc...

    If your are using "cons cells" in your program, use car and cdr.
    If you are using lists that are implemented via cons cells use first and rest.
    If you are using a stack use push and pop.
    And so on...

    In other words:

    CL-USER> (car (cons 1 2))
    1
    CL-USER> (cdr (cons 1 2))
    2
    CL-USER> (first (list 1 2 3))
    1
    CL-USER> (rest (list 1 2 3))
    (2 3)

    Justin Dubs

    1. Re:That's not what car and cdr are for... by millennial · · Score: 1

      Oddly enough we only got into *very* basic LISP in my PL class. I love that 'basic' LISP can be enough to write an interpreter, though :B

      --
      I am scientifically inaccurate.
  56. An ideal world would run on LISP... by Florian · · Score: 4, Insightful
    It's amazing and somwhat sad that programming languages and runtime environments from Smalltalk to Java to Python to C#/.NET keep reinventing the wheel while a language from the 1950s has it all and does it even better - the most elegant syntax thinkable, powerful paradigms for code reuse, dynamic typing, modern memory management with no buffer overflows, and, with Common Lisp, one robust, industrial-strength language with a rich standard library that can both interpreted and compile code, obsoleting the difference between "programming" and "scripting" languages.

    The initial vision of the GNU system - remember "GNU's not Unix" - was to combine a kernel written in C for performance reasons with a userland written largely in LISP. Emacs is the only remnant of that idea, isn't even LISP in its program core, and uses its own LISP dialect instead of CLISP or Scheme. [The climacs project, a CLISP reimplementation of Emacs, tries to fix that.]

    Two years ago, I saw a practical demonstration of a Symbolics LISP Machine from 1987. It was like seeing the light of the holy hacker grail - the first system whose userland was superior to commandline Unix in every aspect [Plan9 has superior kernel design to Unix/BSD/Linux, but its mouse-centric userland sucks IMHO]. Everything was in one language, syntax and namespace. You could hack and debug the kernel (written in LISP, too) while it was running [!], the commandline userland hooked into every aspect of the system, and could be endlessly and seamlessly extended it just through custom LISP functions and eval-ing them.

    Let's dream and hope that perhaps in one or two decades, when insight into the limitations of the Unix paradigm has become common sense, we will have a free Lisp OS as the next iteration of Free Software computing...

    --
    gopher://cramer.plaintext.cc http://cramer.plaintext.cc:70
    1. Re:An ideal world would run on LISP... by Anonymous Coward · · Score: 1, Interesting

      I'd really like to see a modern Lisp machine. I'd like to be able to pull up a Lisp console in any application I use to allow automation of any task. For example, instead of using an awkward autodownloader that can never separate the files I want from those I don't want imagine if your web browser would let you write a short program that examines all of the links on a page and downloads the ones that meet certain criteria.

      I want a universal macro language and I want every program to expose the full depth of its functionality through it and Lisp is ideal for this since it allows relatively compact expressions to do very complicated tasks.

    2. Re:An ideal world would run on LISP... by noahm · · Score: 3, Informative
      Two years ago, I saw a practical demonstration of a Symbolics LISP Machine from 1987

      The frightening thing is, lispms from the 80's enjoy quite some popularity among certain people where I work. They really are amazing machines, and those who use them regularly feel strongly that there hasn't been a more usable environment in all the time since they were created.

      Let me tell you, though, as a sysadmin, these things can be a royal PITA. Not because there's anything wrong with them (well, except maybe for their complete lack of security) but they're just so different.

      There are still many copies of The Lisp Machine Manual lying around, including an early rant by RMS against the recent trend of software hoarding. It makes for an interesting read...

      noah

    3. Re:An ideal world would run on LISP... by nml · · Score: 1

      It's amazing and somwhat sad that programming languages and runtime environments from Smalltalk to Java to Python to C#/.NET keep reinventing the wheel while a language from the 1950s has the most advanced form of rabid language advocacy yet - smug lisp weenies

    4. Re:An ideal world would run on LISP... by stesch · · Score: 1

      By the way: CLISP is just one implementation of Common Lisp. A common abbreviation for Common Lisp is CL.

    5. Re:An ideal world would run on LISP... by Boronx · · Score: 1

      A Lisp OS for x86 processors. Don't ask me if it works because I don't know. Sure doesn't look like it's very far along yet.

    6. Re:An ideal world would run on LISP... by bhurt · · Score: 1

      You could hack and debug the kernel (written in LISP, too) while it was running [!]

      Now, secure this OS from malware...

      I don't want userspace to be able to hack the kernel. This is one of those ideas that sounds neater than it is.

    7. Re:An ideal world would run on LISP... by Anonymous Coward · · Score: 0

      Well, I suppose loadable device drivers are right out, then.

    8. Re:An ideal world would run on LISP... by be-fan · · Score: 1

      That's just a stupid, knee-jerk reaction. First, This OS, being programmed in a safe language, was naturally impervious to buffer overruns, which plague OSs written in C. Second, you're assuming that there were no safety mechanisms in place. In an OS written in a safe language, the kernel/userspace boundry ceases to exist. Since the boundry is no longer necessary for protection (don't want the user to touch a critical piece of data? Easy, just don't give them a reference to it --- there is no other way for them to get at it). So you can keep core functionality behind protected interfaces, and expose the stuff that's safe for the user to userland. Think of it in like the HURD. You allow the user a tremendous amount of flexibility (eg: write their own translators, mount their own devices), and use a fine-grained protection mechanism to make it safe.

      --
      A deep unwavering belief is a sure sign you're missing something...
  57. Little LISPer? by Anonymous Coward · · Score: 0

    Does anyone remember the 'little LISPer'? That is what I learned on. One of the strangest, and perhaps most effective, CS books I ever owned.

    http://www.cs.oberlin.edu/faculty/rms/htx_apps/lis per/llisp.html/

    When the little LISPer went into its fourth printing they renamed it, it is now 'The Little Schemer'.

  58. How about OS interaction by belroth · · Score: 1
    I've checked the online book, can anyone point me at some information on how to interact with the OS from clisp? I want to start/monitor kill processes, check process ids etc. From Windows (2000) and linux.

    I like lisp and would like to use it but I can't find any info on how to do os api interaction.

    Pointers would be appreciated, thanks.

    --
    I hereby inform you that I have NOT been required to provide any decryption keys.
    1. Re:How about OS interaction by dragondestroyer · · Score: 2, Informative

      This website may help http://www.podval.org/~sds/clisp/impnotes/syscalls .html, but be careful as it is not always completely clear which functions work on which platforms.

    2. Re:How about OS interaction by sdssds · · Score: 1

      see CLISP module syscalls

    3. Re:How about OS interaction by cstacy · · Score: 2, Informative
      "clisp" is the name of one implementation of ANSI Common Lisp. There are many implementations of ANSI Common Lisp, and each of them has its own proprietary extensions. "clisp" is unusual in that it is an interpreter (rather than a compiler).

      If you're asking how to manipulate OS processes in Common Lisp in general, the answer is that it is not defined by the ANSI standard. (The reason for this is that each operating system has a different idea what a "process" is, what you can do with them and how you do it, some operating systems don't have processes at all, etc. Processes are beyond the scope of the ANSI standard.) So each implementation does it slightly differently. The leading commercial implementations, in particular, have all these kinds of facilities, and they are portable across operating systems (Mac, Unix, Windows). So if you write your program to those APIs, your program will run on all operating systems.

      If you really meant "clisp", and you want to use their proprietary interface for this, then refer to the documentation entitled, "Implementation Notes". These notes are not about the internals of how clisp is implemented, but rather about the implementation-specific extensions to the language. (That label on their documentation confused me!) These notes come with your clisp distribution.

      If that's not acceptable, because you didn't mean "clisp", or you really need portability not just across operating systems, but also across different vendors' implementations of Common Lisp, people have written libraries which give you portable APIs to things like process manipulation (and network sockets, multiprocessing, and so on).

      These kinds of libraries are much easier to write in Lisp than in other languages. However, I don't know where to get the particular portability library (process manipulation) that you are seeking. I wrote my own. Maybe they are harder to find because it's so easy for people to write their own, but then people don't want to publish them for free. (Or maybe most people are just not writing programs that do a lot of process manipulation. Or they're happy with the non-portability of their programs and consider whatever solution they're using to be "practical" enough.) Anyway, here are some links to places I'd recommend exploring. I don't know if they've got what you want burried in there or not.

      A third solution to your problem, and maybe this is what you're looking for, is that you can just make Unix (or other C-language compatible) calls yourself directly from Common Lisp. The portability library for this is UFFI, the "Universal Foreign Function Interface". You will have to write a function-prototype for the function that you want to call. There might be issues with Unix signals or something. Your code will run in pretty much any ANSI Common Lisp implementation, on any operating system. (The not-yet-identified-maybe-hypothetical portability library for doing process/pid manipulation would itself be written using UFFI library. Not sure if anyone bothered. Extensive libraries for things like SQL database access has been written using UFFI, also.)

      Not having a comprehensive one-stop shopping place for libraries and OS interfaces is one of the things lacking in Common Lisp. Java and Perl have done a somewhat better job in that area, so far.

      Some other good places to look around for libraries and solutions are:

  59. Re:My first exposure to list ( and a mirror of boo by sketerpot · · Score: 3, Insightful
    Some of the key differences between Haskell and Lisp are:
    • Haskell has a strong typing system, similar to that of ML. Lisp's type system is optional, and while many Lisp implementations can do type inference and checking, it isn't required, nor is it as big a part of the language.
    • Haskell is purely functional, and it fakes side-effects with the Monad design pattern. Lisp has side-effects, with all the advantages and disadvantages that entails.
    • Haskell uses lazy evaluation. Lisp uses strict evaluation unless you explicitly ask for lazy evaluation.
    • Lisp, thanks to all those parentheses, has very powerful macros. I know every Lisp fan says this, but they're really cool. Haskell relies more on higher-order functions and infix syntax for that sort of thing, which isn't as powerful but which you may find to be a decent tradeoff.
    • Haskell has significant whitespace, like Python. Lisp doesn't.
    • I find that editing Lisp code is easier than editing Haskell code, due to the excellent Lisp editing modes available for various text editors. OTOH, maybe that's partly because haskell-mode for emacs is pretty rough.
    • Lisp can generally be made faster than Haskell, which is very nice in bottlenecks. For the rest of the program, though, this isn't so major.
  60. Re:Learn Lisp Without Installing Anything on Your by aCapitalist · · Score: 1

    I hope you realize that you have been deprecated in favor of the smug_haskell_weenie.

  61. 4 reasons why you should learn Lisp by Paradox · · Score: 1
    1. It will radically change the way you think about coding. With lisp, you program at something akin to the parse-tree level. There is (almost) no syntax to Lisp except what you make.
    2. It will show you to what higher order functions are canonically used for. Lisp heavily leverages anonymous functions as arguments to the core system calls. Languages with anonymous functions as first-class entities have remarkable properties that let you do amazing things with little effot.
    3. It will teach you about a relatively uncommon variant technique of bottom-up programming, in which you define every problem with a domain-specific language. It is a very powerful technique.
    4. Lisp has very, very powerful Object Oriented facilities. They are also very different from traditional OO features, so they should provide more perspective on the very difficult question, "What is Object Oriented Programming?" (If you think the answer to that question is easy, you need to learn Lisp).
    Cheers.
    --
    Slashdot. It's Not For Common Sense
  62. Things might have been different by amightywind · · Score: 4, Insightful

    It is such a shame that C-based languages took over the computer world in the 1980's. If we had followed the Lisp path instead things might be so much better. C++ with all of the template, RTTI, and STL grunge is such a half-assed imitation of powerful Lisp constructs that have been perfected for 15 years. I won't even go into Java, Python, C#, PHP. What a waste. I suggest you non-Lisp programmers grab a copy of SICP and start over.

    --
    an ill wind that blows no good
    1. Re:Things might have been different by Impy+the+Impiuos+Imp · · Score: 1

      That's true. Lisp was the perfect language to run as a scripting language thanks to its interpreter. It should have killed Java and various scripts in one swoop.

      Stuffing all your data into a list makes life so much easier and faster for development. What, no structs? What what?

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
    2. Re:Things might have been different by inkedmn · · Score: 1

      [1]> (defstruct foo)
      FOO

      --
      well, it's nothing one behind the ear wouldn't cure
    3. Re:Things might have been different by Anonymous Coward · · Score: 0, Offtopic

      Lisp's heyday _was_ in the 1980s, during the AI craze. It has had plenty of time to catch on since it was created in 1959. But it didn't.

    4. Re:Things might have been different by Anonymous Coward · · Score: 2, Insightful


      I would agree, but Lisp is a fragemented platform. The good Lisp environments are expensive and have proprietary GUI add-ons. Is there even a common POSIX layer?

      Sun did one thing right with Java: Microsoft dicked around with it and got swarmed by an army of lawyers. Lisp never had this benefit.

      You claim that other languages are a waste, but what about the evolution of Lisp itself? It seems all the infighting and money grubbing were the waste, IMO. It's sad, though, because Lisp is so nice.

    5. Re:Things might have been different by Anonymous Coward · · Score: 2, Interesting

      If we had followed the Lisp path instead things might be so much better. C++ with all of the template, RTTI, and STL grunge is such a half-assed imitation of powerful Lisp constructs that have been perfected for 15 years. I won't even go into Java, Python, C#, PHP. What a waste. I suggest you non-Lisp programmers grab a copy of SICP and start over.

      What a waste indeed - that Lisp programmers are blind to the real possibilities of real modern languages. I'm not talking about C++, Java, and PHP. I'm talking about ML, Haskell, Ruby. Languages that can do all the useful things Lisp can do, and many things Lisp makes incredibly difficult. And do them faster, or more conveniently, or with a syntax that even programmers whose brains have been poisoned by exposure to C are able to accept.

      I suggest you Lisp programmers open your eyes to what's happening in the interesting parts of the modern language community. You'll find a lot that looks just like the Lisp you love - and a lot of new things you would never have believed were possible.

    6. Re:Things might have been different by Anonymous Coward · · Score: 0

      I suggest you Lisp programmers open your eyes to what's happening in the interesting parts of the modern language community. You'll find a lot that looks just like the Lisp you love - and a lot of new things you would never have believed were possible.

      Examples?

    7. Re:Things might have been different by OOGG_THE_CAVEMAN · · Score: 1

      Lisp was the perfect language to run as a scripting language thanks to its interpreter.

      OOGG admit Lisp was interpreted in stone-age. (Also, was called LISP in stone-age, but OOGG digress). However, since http://c2.com/cgi/wiki?MacLisp MacLisp project, Lisp developers know how write efficient compilers for Lisp.

      In heyday of Lisp Machines, whole OS (including FORTRAN compilers, etc.) written in Lisp, compiled to Lisp-based microcode execute directly on CPU.

      Current Lisp standard support structures, arrays, hash-tables, strings, also sophisticated OOP using CLOS.

      OOGG very happy not have to bang C++ rocks together in order to write powerful programs quickly.

    8. Re:Things might have been different by brpr · · Score: 1

      I'm talking about ML, Haskell, Ruby. Languages that can do all the useful things Lisp can do

      Those are all great languages, but they lack some of Lisp's features (though of course Lisp lacks some of their features too). Macros are the obvious example. Seamless bignum arithmetic is another, in the case of ML and Haskell at least.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
  63. Re:Learn Lisp Without Installing Anything on Your by Fahrenheit+450 · · Score: 1

    I went through Why's guide a few months back to learn enough to work my way through the scripts I run across these days. The only thing I came away from the tutorial was a deep sense of wondering why people find the language so great.

    I suppose compared to C(++), Perl, VB, or whatever it's actually pretty nice. But compared to languages like OCaml, Oz, and Haskell it's... well... it tries hard -- and it's kind of cute. So I guess that's worth something.

    --
    -30-
  64. Re:Good book, questionable language. by nagora · · Score: 1
    As everyone else that's replied to you has pointed out you are talking out your ass. Lisp had exceptions and GC long before Java or C# were even an idea.

    I was amazed to find in an earlier /. thread that C++/C#/Java programmers actually think exception handling was a great new thing when their language came out. What they thought we did "in the old days" is beyond me. But then, C++ programmers have told me that the common template library is a great programming concept and not just a hack to get around the limitations of the language's terrible design.

    TWW

    --
    "Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
  65. Re:My first exposure to list ( and a mirror of boo by omnirealm · · Score: 5, Funny

    Whenever I think of Lisp, I'm transported back in time to 1975 where I'm trying (unsuccessfully) to learn this as my 2nd programming language after Fortran IV (on a DECsystem-10, no less).

    I've heard it said that someone just learning how to program can pick up Lisp in a day. If you happen to already know Fortran, it will take two days.

    --
    An unjust law is no law at all. - St. Augustine
  66. same goes with Perl! by alfiejohn · · Score: 0
  67. MOD PARENT UP by qui_tollis · · Score: 1

    Why on earth was this modded down?

  68. Re:Learn Lisp Without Installing Anything on Your by Infinityis · · Score: 1

    It must be true that Lisp programmers are smarter than the average programmer....you seem to have found a way to double your karma for free!

  69. Lisp quotes by dstone · · Score: 1
  70. Libraries... by Infinityis · · Score: 1

    I'm just getting started learning Lisp (mostly thanks to Paul), and I find myself asking repeatedly--why is it that there aren't good libraries with multiplatorm support? Is it a funding issue, where no one gets paid to so no one does it? I suspect that if it were a more popular language, it might find better support, but the catch-22 is that it needs more libraries (and thus support) to become more popular. Even then, popularity isn't the goal, so much as the byproduct of marrying a powerful language to equally useful libraries. Perhaps the word I'm looking for is more "developer-ready" than "popular".

    In any case, does anyone think/know that it's possible to get Lisp to such a level or sophistication? Are major changes (*ahem* Arc) necessary to make it less "strange" without reducing power? Could the beginning programmer someday feasibly write a program in Visual Lisp, or can we not mix ease of development and powerful languages? If such a venture is possible, is anyone (even Paul) willing to support it? I suppose it retrospect it would have been fun to submit such an idea to Paul's VC setup, but I doubt it would have made it in light of the long-term nature of such development.

    1. Re:Libraries... by rsheridan6 · · Score: 1
      I don't think the problem is lack of libraries, because new languages like Python have come along and outstripped Lisp's library support. I think Lisp's lack of popularity stems mainly from 2 things:

      1) It's alien. It's a bigger jump to go from C to Lisp than it is to go from C to Perl or Python. Technology succeeds by disturbing peoples' habits as little as possible.

      2) Its roots are in academe and AI. The Lisp culture was never oriented towards what most grunt programmers would consider practical work. That's why it's a pain in the ass to certain things in Lisp that are easy in Perl - the people who designed Lisp didn't care about those things. There's nothing inherent in Lisp that makes what would be a simple one-liner in Perl more difficult, it's just not the focus of the language. Name one successful language that was created by academics.

      There's also no inherent reason why there couldn't be a Visual Lisp, other than that Lispers like Emacs and aren't likely to develop something like that. (actually, if you count Scheme as a dialect of Lisp, DrScheme comes close).

      --
      Don't drop the soap, Tommy!
    2. Re:Libraries... by circusboy · · Score: 2, Informative

      this is a good set to start with, and look up asdf and asdf install for further libraries that are cross platform/implementation for lisp. saves a lot of trouble, and evens out the differences between the various lithpssssssss

      --
      -- it's ridiculous how many people misspell ridiculous... (damn, damn, damn...)
    3. Re:Libraries... by Anonymous Coward · · Score: 1, Informative

      There are many different Common Lisp implementations around, each having a different foreign function interface. This makes it harder to develop and maintain interfaces to existing libraries since each must be ported to a number of CL implementations. (In Python, Perl, Ruby, etc. you have one implementation of the language and when you port your library to that you are done.)

      Regarding strangeness: Common Lisp has hertiage from different formerly used Lisp dialects. This explains why the function names and some concepts are so inconsistent. It you want a clean and consistent Lisp, look at Scheme. Scheme was designed from scratch with teaching/learning in mind. However it doesn't come with some of CLs cool features (such as a built-in compiler). In my personal opinion another Lisp dialect is the last thing the world needs. But that might just be me... :-)

    4. Re:Libraries... by jlandahl · · Score: 1

      There definitely are "good libraries with multiplatform support", and I listed a few of them elsewhere in this topic.

      As for "Visual Lisp", if what you mean is a powerful IDE for Common Lisp, the commercial implementations have had these for years. Download the trial versions of Allegro Common Lisp and LispWorks and take them for a spin. They're expensive to license, but they're also (arguably) the best implementations of Common Lisp you'll find.

  71. Re:Good book, questionable language. by Ulrich+Hobelmann · · Score: 2, Informative

    You are clueless.

    Common Lisp is lexically scoped, in fact it has closures (unlike Java). 1984 it was standardized with a really powerful CLOS (CL object system), in comparison to the puny Java object system 10 years later.

    Lisp also *invented* garbage collection! Without it you'd still be using FORTRAN, not Java.

    And the AI comment is simply stupid. Any language can be used to do AI; Lisp is simply used for it, because it's way more powerful than Java and other crap.

  72. Re:Practical Common Lisp???!!! by rossifer · · Score: 1

    At the time there were few tools that would indicate how/where parenthesis balanced (and no integrated IDEs)

    I suspect that someone was pulling the wool over your eyes. Lisp has had fully featured IDE's almost since it was originally implemented.

    A lisp shell environment is a true text-based IDE, with features that "modern" IDE's are still trying to catch up to. The editor, compiler, and debugger are all available exactly how and when you want them to be. As for the parens, I don't know how long emacs has done parenthesis matching and lisp autoformatting. Those features were there when I wrote my first lisp program in 1989, more than 16 years ago. I'm sure some of the more experienced lispers could give an authoritative answer as to when this happened (though I suspect that emacs has had these features since shortly after the appearance of elisp).

    Now if you mean by "Integrated IDE", something that looks like eclipse or MS Dev Studio, well, yeah. Except for the UI builder, the complexity of those tools is there to help you deal with the fact that the language isn't helping you very much.

    IMHO, the one thing that lisp really lacks and Java really has is effective packaging of deliverables. The combined ClassLoader concept and the .jar file are actual genius. I'm still waiting for someone to find a way to deliver lisp-based capabilities so cleanly.

    Regards,
    Ross

  73. Thankyou Dennis by beforewisdom · · Score: 1

    (if (or (= lisp practical) (= lisp common)) (monkeys-fly-out 'my-ass) (life-as-normal))


    I would like to thank my friend Dennis, who in addition to being a MAC crank is also a LISP zealot who motivated me to read at least part of an introductory LISP manual a few years ago.

    Because of him I can understand this posters joke, and I am not even on any kind of drugs.

    Dennis, thanks again for all of the free, high enthusiasm lectures on LISP.

    If I could wave a magic wand I would the primary concern of the I.T. industry to be about doing things right which would result in a plethora of LISP programming jobs ... most of which would be on MAC OSX platforms.
  74. J. Morrison's corollary to Greenspun's tenth rule by Julian+Morrison · · Score: 1

    All real-world Common Lisp implementations are bug-ridden, slow and generally implement about half of Common Lisp, plus sufficient ad-hoc informally-specified extensions to drag it into the modern era.

  75. Yes, ESR is a pompus ass but by xeno-cat · · Score: 1

    Lets not let him poison everything in the FOSS world. I think it's best to just tune ESR out then to react to anything he says. That way you don't conceed any power to him at all. LISP really is amazing. Especially as it was first written in ~1958 and basically solved all of modern computing in one fell swoop. All modern languages are striving to become LISP (ok, but learn some LISP and you'll see what I mean).

    If your a programmer than understanding LISP is something I can not recomend highly enough. You won't look at any language the same way again (Java, .NET, SmallTalk, C/++, Python, Perl, etc.).

    Kind Regards

    --
    "A few great minds are enough to endow humanity with monstrous power, but a few great hearts are not enough to make us w
    1. Re:Yes, ESR is a pompus ass but by Anonymous Coward · · Score: 0

      Lisp is great *despite* the fact that the pompous blowhard ESR has something good to say about it.

    2. Re:Yes, ESR is a pompus ass but by Anonymous Coward · · Score: 0

      If your a programmer

      "you're".

  76. Comment removed by account_deleted · · Score: 2, Informative

    Comment removed based on user account deletion

  77. interesting subject by grumpyman · · Score: 0, Troll

    Practical Common Lisp? LOL! Lisp is a language that's fairly impractical, definitely uncommon, and a lot of people pronounce it Lips :)

  78. Practical by Darth_Burrito · · Score: 1

    This seems to be a book about practical tasks in lisp but not necessarily practical lisp. For example, why would it be practical to do web programming in LISP instead of a platform like PHP, JSP, ASP.NET, or even Perl? All of these platforms have enormous community support for web development in terms of libraries and resources.

    Am I wrong here? If not, for what tasks is LISP a practical aka appropriate, tool? From what I've seen, it's popular and presumably good for some AI work (although most of the younger AI guys I've known seem to use other tools) and it's also good for teaching students about functional programming and language theory. What else?

    1. Re:Practical by Animats · · Score: 1
      For example, why would it be practical to do web programming in LISP instead of a platform like PHP, JSP, ASP.NET, or even Perl?

      Yahoo Store (previously Viamall) was a LISP application. That was something of a secret at the time; the developers didn't want to give up their competitive advantage.

    2. Re:Practical by noahm · · Score: 1
      Yahoo Store (previously Viamall) was a LISP application. That was something of a secret at the time; the developers didn't want to give up their competitive advantage.

      ITA Software, the company whose back-end powers sites like Orbitz.com, uses a significant amount of Lisp code in their applications.

      noah

    3. Re:Practical by mattknox · · Score: 1

      Lisp will tend to dominate wherever the compute-to communication ratio is high, and the task is fairly complex.

      What I mean by this is that if you spend, say, 10 times as much effort doing things as you do getting input or providing output, then lisp will probably be a huge win.
      If you are wiring together a bunch of unix commands, bash or perl is pretty tough to beat (although scsh-scheme shell-is a decent entry here, too).
      If you are writing device drivers, you will want assembler or C (or Schemeix-a kernel module that allows you to use tinyscheme to write device drivers in a garbage collected language with exception handling and continuations).
      If you are going to do lots of talking to databases, then there are tons of options(like making up a mini-language in lisp/scheme to suit your needs, or skipping the db entirely).
      If you have very heavy lifting to do-calculate the cheapest airfare from NYC-JFK to LAX or something similarly crazy-hard-then lisp is among the very few languages that are a legitimate option.

    4. Re:Practical by circusboy · · Score: 1

      I think it might be related to the idea that LISP and HTML are very similar in basic construction, i.e. nested structures. and if you are dealing with a language whose construction and operations are based on a similar construction model to the data. the parallel is pretty neat and convenient.

      you might be able to equate this thought with those people who think that CSS is bad for XM, as CSS is not in itself a valid XML doc. where if you develop a style sheet that is pure XML you can operate on the data and the style in the same way. (for what that's worth...)

      I think for me the hardest thing for me is wrapping my head around the concept of "state-that-is" rather than "program-that-runs." It's getting easier, but slowly.

      --
      -- it's ridiculous how many people misspell ridiculous... (damn, damn, damn...)
    5. Re:Practical by foote · · Score: 1

      Paul Graham's site has a short piece about Orbitz's use of Lisp, called Inside Orbitz.

    6. Re:Practical by drew+crampsie · · Score: 1
      why would it be practical to do web programming in LISP instead of a platform like PHP, JSP, ASP.NET, or even Perl?

      Because those other languages are terrible at web programming. I program Common Lisp web applications for a living, and i've found it to be the best tool for the job. I'm into Continuation based web programming now (rather than the ad-hoc finite-state-machine model), and you can add CPS transformation to CL with a few macros.

      PHP, Perl, etc are all a little slow when compared to (a native compiled) Lisp as well. The cliki i run at http://lisp.tech.coop/ was slashdotted this morning. It runs under araneida ( a lisp based web server) and SBCL. It does not use threads or fork processes, but does all the work in a single process using SERVE-EVENT (which is like unix select()).

      So, a single lisp process can handle a minor slashdotting (on a UML instance with 128 mb ram). That seems like a good reason to try lisp.

      http://lisp.tech.coop/Web%2fContinuation might give you some idea as to the power of lisp for web programming. I suggest you give CL a try. if you are looking for a better way to write web applications, lisp may just be for you

      --
      Drew Crampsie - Software Developer
      Open Source Business : The Tec
    7. Re:Practical by Darth_Burrito · · Score: 1

      That was created by Paul Graham wasn't it? Given that he is the author of the definitive LISP text and one of the languages strongest proponents and an extremely smart guy, I don't know that his success with LISP translates to the rest of the world.

  79. Practical Lisp? by Zangief · · Score: 2, Insightful

    I have yet to find a lisp implementation that:

    1-it is open sourced.
    2-it has some GUI support (tk or gtk).
    3-it is cross platform (including the GUI support).
    4-it is estable, not in some estate of eternal beta.
    5-it is embeddable in a web server (yes, I know Mod_lisp exists. But, yet it doesn't comply with 2 or 3)

    If a young language, like Ruby or Python, can do this, why the hell Lisp, one of the oldest languages around, can't?!

    Until I find something like that, I can't say Lisp is practical, no matter how theoretically cool it is.

    1. Re:Practical Lisp? by Anonymous Coward · · Score: 0

      Practicality is relative. Lisp is practical for AI, but impractical for some more mundane tasks (not because of the language, but because of the library/implementation situ.

    2. Re:Practical Lisp? by Anonymous Coward · · Score: 0

      If anyone is avoiding Lisp and Scheme because of this, make sure to check out PLT Scheme and other Schemes.

    3. Re:Practical Lisp? by Anonymous Coward · · Score: 1, Informative
    4. Re:Practical Lisp? by Nicolay77 · · Score: 1

      I believe a embeddable lisp with a wxWindows library would be "the" killer platform.

      It would have DBs, GUI, threads, and of all the object oriented C descendants, C++ the wxWindows version (because it feels like that) is the one I like the most (much much more than Java).

      There was a project like that a couple of years ago, but it seems to have vanished... :/

      --
      We are Turing O-Machines. The Oracle is out there.
  80. Comment removed by account_deleted · · Score: 2, Insightful

    Comment removed based on user account deletion

  81. That's rediculous. by Some+Random+Username · · Score: 1

    So, you know full well that your example is simple to impliment in dozens of languages, but you want to add a stupid restriction that doesn't actually make a difference in solving a problem, just to make it seem like lisp is special? I don't care if you want me to add a new keyword to my language, that doesn't solve a problem, and has no practical relevance. Present a real problem that is significantly easier to solve using lisp than it is in a typical dynamic language.

    1. Re:That's rediculous. by Anonymous Coward · · Score: 0

      The fact that you think it's simple to implement in dozens of languages indicates you don't fully understand LISP macros.

      And, do you really think that junior programmers forgetting or not knowing how to properly close open streams/readers/writers/db connections/etc isn't a "real world problem"?

  82. Encore! Encore! by Anonymous Coward · · Score: 0
    Yes, because we all *know* how often you need a new keyword to insert sleep calls between statements. And that a dispatch table wouldn't be as sexy.
    #!/usr/bin/perl

    @funcs = (&foo, &bar, &baz);
    do {$_->(); sleep($N)} for @funcs;
    1. Re:Encore! Encore! by Anonymous Coward · · Score: 0

      What you're doing is rewriting part of your program in an absurdly limited language for which you've provided an interpreter. The equivalent in Lisp still lets you use all of Lisp in the steps, and gives the optimizer full access to the resulting program.

  83. MACROS DO NOT EVALUATE THEIR ARGUMENTS by Anonymous Coward · · Score: 0

    Whoop-de-doo. Macros don't evaluate their arguments. But you do realize that this is because call-by-value is ugly. Try a nice language like Haskell some time. And just how many special forms are in CL? Oh yeah, we'll just gloss over the fact that we've merely moved our choice of nastiness from syntax to library functions.

  84. You know you want to ... by Anonymous Coward · · Score: 0

    Go ... and wank ...

  85. Re:LISP is amazing NOT by Anonymous Coward · · Score: 0
    (html (:ul (dolist (item stuff)) (html (:li item))))
    That's it!!?! or sibling:
    tran { //db operations go here
    } rollback { // code handling rollback
    } success { // code specific to a successful transaction
    }
    And that's all?? I'M SO UNIMPRESSED it's not even funny, I've played with LISP in the past and the only thing I got was: a headache, tired eyes and "I can do this easily in #{your_guess}".
  86. Re:I'm thorry, by Anonymous Coward · · Score: 0

    I can't help that I have a lithp, you inthenthitive clodth!!

  87. Re:My first exposure to list ( and a mirror of boo by Anonymous Coward · · Score: 2, Informative

    Haskell has significant whitespace,

    Optional significant whitespace, but everyone uses it. IM(anonymous)O it works a lot better in a functional language than imperitive.

    Haskell syntax is really amazingly beautiful. Usually. Even if you don't find Lisp interesting, have look at Haskell.

  88. Re:My first exposure to list ( and a mirror of boo by Anonymous Coward · · Score: 2, Informative

    Wrong. The entire text of the book is on-line.

  89. Re:LISP is amazing. (really? -- yes) by Anonymous Coward · · Score: 0

    Not quite. CAR = Contents of Address (part of) Register; CDR = Contents of Decrement (part of) Register (not Data). In those days, "register" just meant "memory location" - if you had, say, 8k of (36 bit wide) memory, you had 8k registers. Each of the CAR and CDR instructions accessed a piece of the 36 bit word.

  90. someone ought to update and simplify the language by cahiha · · Score: 1

    CommonLisp has acquired lots of warts and problems over the last two decades. There is a lot of cumbersome stuff in it that isn't needed anymore (e.g., completely general floating point and character set support). There is a lot of stuff that is missing from the standard library: threads, sockets, a foreign function interface, etc. And then there is some stuff that is just poorly designed (e.g., function cells, arrays).

    Unfortunately, CommonLisp is likely to be the last big Lisp standard for a long time, simply because the number of people who still bother is so smarll.

  91. Arc would probably get widely taken up by Szplug · · Score: 3, Interesting

    Paul Graham's Arc is the great hope (there's a lot of interest in it at least). If it is elegant as promised I think Lispers would take it up. But, it's pretty ambitious and he appears stuck for the time being; the most recent I've heard on the subject is this comment (2nd down) at lemonodor. He's said he intends it to be a hundred-year language and that he'll take his time, so, everyone'll have to make do with CL for the while.

    --
    Someday we'll all be negroes
    1. Re:Arc would probably get widely taken up by cpeterso · · Score: 1



      While we wait for Arc, Paul Graham's Lisp FAQ has his Lisp recommendations:

      Do you know a good, free Lisp implementation?

      There are several. The Common Lisp implementation I use is Clisp, but CMUCL is also well-regarded. For Scheme hacking I use Scheme 48 and PLT Scheme.

    2. Re:Arc would probably get widely taken up by boots@work · · Score: 1

      Lisp needs a new incompatible dialect like it needs another hole in its foot. The problem with more widespread adoption of lisp is the lack of a good, free, widely standardized implementation. Practically every Lisp text begins with an apology for the fact that your implementation probably won't work exactly the same as the one the author used.

      But then Paul knows far more about the problem than I do, and if it turns out he's right I'll be delighted.

  92. Pedant Alert! by Anonymous Coward · · Score: 0

    OK. This goes WAY beyond trivia, but the original thesis had LITHP 1.5 on the cover sheet, but LISP 1.5 on the title page (and internally). I know because I took Introduction to Automatic Computation (a Freshman elective) from the McC himself in 1960 and saw his paper. Unfortunately, we only wrote in Meta-Lisp (curly braces, right arrows, etc.) and I never found out how to turn all that into incredible numbers of parentheses. This meant that everything we did (grouping of terms, symbolic differentiation, etc.) was desk-checked, not computer run. (sigh)

    parl

  93. LISP is amazing-Gastic noises. by Anonymous Coward · · Score: 0

    "These are sort of cryptic names, but at least they have some relation to what they actually do, as opposed to "car" and "cdr"."

    I find complaints about cryptic names ironic coming from a group that uses a Unix-lookalike OS.

  94. Good book, questionable history. by Anonymous Coward · · Score: 0

    "What they thought we did "in the old days" is beyond me."

    Those who don't live history, are doomed to repeating it.

  95. Close, IBM 704 by Anonymous Coward · · Score: 0

    It was an IBM 704, which was the Scientific sibling to the IBM 1401, for Business and Accounting. The 704 was succeeded by the 709, 7040, 7090 and eventually the 7094 (uniting the 704 and 709 branches). The 360 was the union of the 7 and 14 branches, so as to provide for the full circle (360) of your applications. One model of the 360 actually had a switch where it (slowly) emulated a 1401. The County of Marin (CA) was lured away from IBM because Honeywell (?) promised to convert their 1401 programs to COBOL and free them from running their 360 in emulation mode.

    parl

  96. Re: C for lispers by Anonymous Coward · · Score: 0

    #define STMT(a) a;
    #define DECL(a,b) a b
    #define RET(a) STMT(return a)
    #define DEFUN(a,b,c,d) a b c { d }
    #define LET(a,b) ((a)=(b))
    #define ADD(a,b) ((a)+(b))
    #define MUL(a,b) ((a)*(b))
    #define PTR(x) x*
    /* TODO: fill in the rest */

    DEFUN (int, main, (DECL (int, argc), DECL (PTR (PTR (char)), argv)),
    STMT (DECL (int, x))
    STMT (printf ("%d\n", (LET (x, (MUL (ADD (1, 2), (ADD (3, 4))))))))
    RET (0))

    /* I feel dirty now. :-( */

  97. Re:J. Morrison's corollary to Greenspun's tenth ru by Anonymous Coward · · Score: 0

    Name one Common Lisp implementation which is bug-ridden, slow, or only implements half of Common Lisp! My guess: you've never even seen a Common Lisp implementation, and probably never even heard of the language until now.

  98. My 2 cents on Lisp and FP by Tablizer · · Score: 2, Interesting

    I have had long debates with Lisp fans and FP fans. In the end I concluded:

    1. FP simplifies bad practices. If you avoid certain poor programming practices of coupling things that shouldn't be coupled, then FP's advantages are only incrimental at best. My opponents kept saying, "See what I can do with FP!", and I kept countering, "But that is not a good design" or "I don't need that feature that often", which is the truth.

    2. Lisp's uniformity of syntax makes it powerful, but also very difficult to read. Other languages have syntax that acts like landmarks. Lisp is like having every house be the same such that it's power comes from the arrangement of the houses, but other languages mix in houses, stores, trailers, etc. to give visual landmarks to lock onto. Lisp is just too damned monotonous. Somewhat ugly syntax is more memorable. I tried to get "into" Lisp, but just found it too hard to visually process.

    1. Re:My 2 cents on Lisp and FP by Anonymous Coward · · Score: 0

      I agree to some extent with #1; a good programmer can write functional code in any language, so the benefits from switching might be incremental for you when writing code in isolation.

      However, most programmers are not good at all and even some of the good ones will write very different code to you sometimes and you have to work with all of them, so I think of functional languages as a very effective excercise in damage limitation.

      On top of this, requirements evolve, making your good programs into bad ones, and functional programs are the easiest to orthogonally refactor - i.e. to change exactly what needs changing without repercussions cascading through the rest of the program. This means faster and much more reliable maintenance.

    2. Re:My 2 cents on Lisp and FP by Tiny+Elvis · · Score: 2, Interesting

      #2: most languages are difficult to read until your eyes are 'tuned' to it. Lisp is no different. When I started I agree it was hard to see the program flow. It did not take long before the ()'s disappeared from my attention and the program structure became more accessible. I love that everything in Lisp is an expression, there is not statement/experession distinction. This make the code incredibly flexible. Also, CL macros are extremely powerful, they are made possible by the simple syntax.

    3. Re:My 2 cents on Lisp and FP by Tablizer · · Score: 1

      On top of this, requirements evolve, making your good programs into bad ones, and functional programs are the easiest to orthogonally refactor - i.e. to change exactly what needs changing without repercussions cascading through the rest of the program. This means faster and much more reliable maintenance.

      I would like to see a specific example/scenario.

    4. Re:My 2 cents on Lisp and FP by Tablizer · · Score: 1

      most languages are difficult to read until your eyes are 'tuned' to it. Lisp is no different.

      Couldn't somebody say the same about anything? Assembler? Binary?

    5. Re:My 2 cents on Lisp and FP by be-fan · · Score: 1

      (1) is a useless statement, because in the absence of examples, there is no way to rationally respond to your post.

      (2) is just a sign you're not using a good IDE.

      --
      A deep unwavering belief is a sure sign you're missing something...
    6. Re:My 2 cents on Lisp and FP by Gorbag · · Score: 1
      . Lisp's uniformity of syntax makes it powerful, but also very difficult to read. Other languages have syntax that acts like landmarks. Lisp is like having every house be the same such that it's power comes from the arrangement of the houses, but other languages mix in houses, stores, trailers, etc. to give visual landmarks to lock onto. Lisp is just too damned monotonous. Somewhat ugly syntax is more memorable. I tried to get "into" Lisp, but just found it too hard to visually process.
      So, use emacs and turn on font-lock mode. You can modify the mode to recognize your own macros or favorite functions and highlight them however you like.
      --
      -- I speak only for myself
    7. Re:My 2 cents on Lisp and FP by Tablizer · · Score: 1

      (1) is a useless statement, because in the absence of examples, there is no way to rationally respond to your post.

      That is true of many posts here. Respond to my slashdot handle and I will lead you to examples.

      (2) is just a sign you're not using a good IDE.

      That is a crutch IMO. A good language should be perfectly legible without IDE gimmicks. Plus, the shortcommings of many things/languages can be helped with a strong enough IDE.

  99. Re:Practical Common Lisp???!!! by ari_j · · Score: 1

    Java has the distinct advantage of being available everywhere, largely because of the convenience that a .jar will run more or less the same on Windows, Mac, Solaris, and Linux. Lisp suffers from the variety of interpreters/compilers/"engines"/whatever-else that is available. You can't write code to SBCL and expect it to run on CLISP on Windows or OpenMCL on MacOS X. If that hurdle had been overcome by 1997, Lisp might very well have become the dominant platform instead of Java.

  100. I would like to thank by circusboy · · Score: 1

    the general populace here, this has been one of the more informative discussions I think I've ever seen here. some of the practical points have been very informative.

    thank you.

    --
    -- it's ridiculous how many people misspell ridiculous... (damn, damn, damn...)
    1. Re:I would like to thank by Anonymous Coward · · Score: 0

      Yes, great discussion.

  101. Re:Practical Common Lisp???!!! by Anonymous Coward · · Score: 0

    "Several years"? Paren-matching IDEs for Lisp have been around since the early 1970s. And if you were writing Lisp in the 60s, I'm King of the Universe.

  102. Wow... by Da+VinMan · · Score: 1

    That is cool. Now I get it. Don't lose that example; it works.

    I heard some vague talking up of macros before and I sort of understood the superficial impact of it, but I hadn't seen an example like that before that kind of hits home.

    Now, having said that, I can easily come back with something like "yeah, but I can do the same thing in Java with a helper class that has a bunch of methods; then instead of using my mystical magical LISP macro thingy that no one will understand, I just call my methods when I need them". And that would be true. But I think the "magic" here in LISP is that by going at it with macros and using those to change the appearance of your programs, you're providing a sort of cognitive shift to the programmer where they can think about each category of problem in the system as a "mini-language". That renders a way for the programmer to feel like they're in control and like the solution feels more elegant, because it's less encumbered by syntactical baggage. Is that about right in your experience?

    Well, between this and Ruby, I'll have my hands full for a while. Who knows, I may even do something useful with them someday. (Heck, it worked out that way when I went and learned Python on a lark.)

    Thank you!

    --
    Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    1. Re:Wow... by jonhaug · · Score: 1

      But I think the "magic" here in LISP is that by going at it with macros and using those to change the appearance of your programs, you're providing a sort of cognitive shift to the programmer where they can think about each category of problem in the system as a "mini-language". That renders a way for the programmer to feel like they're in control and like the solution feels more elegant, because it's less encumbered by syntactical baggage. Is that about right in your experience?

      This is exactly how I feel. The thing that most people forget with programming, is that it is a tremendous abstraction workout. When someone tells me that he can do everything in his or her favroutie language, the person is just clueless. You actually need to work on an effective abstraction layer to be able to build anything. Lisp is just today the most suitable language to rapidly make your own abstraction layer.

      In fact, computer sience as such is not only algorithms, formalism, social impact and all those things discussed endlessly, it is also the sicence of abstractions and even more than any other themes you'll might find.

      The bad thing about macros, is that it can slide out of your control, thus making a language not even you yourself can understand.

    2. Re:Wow... by Anonymous Coward · · Score: 1, Insightful

      But I think the "magic" here in LISP is that by going at it with macros and using those to change the appearance of your programs, you're providing a sort of cognitive shift to the programmer where they can think about each category of problem in the system as a "mini-language". That renders a way for the programmer to feel like they're in control and like the solution feels more elegant, because it's less encumbered by syntactical baggage. Is that about right in your experience?

      That's exactly right. Those who continually respond "but I could do that in [Blub]" are missing this point. The approach is known as writing a "domain specific language" (DSL) or, as Paul Graham calls it, "bottom up programming". Instead of trying to reduce your problem to the level of a general purpose language like Java or Python, you bring the language up to meet your problem domain. In effect, you create the language best suited to solving your problem, then solve the problem with it. The end result is a leaner, tighter program which is less encumbered not just by syntactic baggage, but semantic baggage as well. Every line of code you don't have to write is a line of code you don't have to understand and support later, and Lisp macros allow you to save hundreds and even thousands of lines of code throughout your application's code base.

    3. Re:Wow... by haystor · · Score: 1

      In spite of programming Java and Perl consistently for the last 8 years, I'm considerably more productive in LISP, even as a relative newcomer. LISP bends to my will and does what I command. The patterns crowd apparently needs to be walked through a path outlining what they need to get done. I can sit back, look at the problem and solve it.

      My code reuse shot through the roof when I switched to LISP, too. Java seems to have lots of comforting lines of code that get repeated over and over. It always struck me as wrong that I have to write those same lines *every damned time*. Some of these Java problems are being addressed by code generation. All I have to say about that is code generation is a cheap substitute for runtime expansion.

      Sadly, Java pays better but that is irrelevant to those of us rediscovering the joys of programming.

      --
      t
    4. Re:Wow... by Da+VinMan · · Score: 1

      The bad thing about macros, is that it can slide out of your control, thus making a language not even you yourself can understand.

      OK, now I think you've hit the nail on the head with this observation; as I've heard this difficulty related to me by long time LISPers before. I've read some LISP macro code, and it looks anything but simple. It's just not a pleasure to look at. So, I'm wondering, is there a way to make this a more pleasant task (with or without LISP)?

      Really, if Python, Ruby, or the like really supported macro expansion (and truly compiled executables, etc. (and no py2exe and its ilk doesn't actually count)), we wouldn't be having this conversation. But since this appears to be "The Last Great Feature" of LISP (aside from that sexy parenthesis based syntax you all seem to love :), that newer languages don't really support yet, I'm wondering how I can partake of the macro magic goodness without having to immerse myself in a positively opaque and smug community of folks who, for the most part, only get to practice this magic as a hobby.

      So, am I making sense? I want to be able to take this into my work life (.NET and J2EE preferably - hold yer fire; I have a family to feed!). Please, save me from the upcoming trend of code generation that is going to drown us all in a mountain of unintelligible code!!!

      (Yeah, I want it all! :+)

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    5. Re:Wow... by haystor · · Score: 1

      Quit work, buy a license from franz.com and make your own stuff. I did.

      The macro code is very complicated because it does complicated things. The good part is that it keeps those complications all in one little place.

      There is a small smug, employed community that can't appeal to the masses. If I proposed using LISP to a client they would want to know how we'd be able to find 20 LISP programmers. Companies feel safer hiring mediocre programmers and hiring lots of them. (as an aside, I think this is one of the appealing things about offshoring)

      LISP rewards good programmers with things that Java and its ilk think are beyond your capability. It is for people that are creating something new and wonderful. Java rewards the mediocre with rote application for decent pay.

      There is no high road to LISP.

      --
      t
    6. Re:Wow... by Anonymous Coward · · Score: 0

      > Quit work, buy a license from franz.com and make your own stuff. I did.

      Still no free compiler for windows that's worth a damn. Corman's very nice, but CLOS is very broken. CLISP is dreadful dreadful slow (except numerics .. boy is it fast with numerics).

      No Lisp I know of supports a lightweight coroutine model. Full threads suck in many ways, not the least of which is that they take up enormous amounts of RAM. No Scheme implementation seems to implement them well either, but the groundwork is there with continuations. Continuations are REALLY nice for building web frameworks, for one. And guis are a breeze with microthreads.

      CLOS has a plethora of warts, though I suppose any object model does.

  103. 25 years with LISP by Anonymous Coward · · Score: 0

    I learned LISP a long time ago, perhaps 25 years now.

    I do not find it useful for my daily job due to the library issues and performance related concerns. I do still dust it off sometimes for personal projects.

    However, I consider it the most elegant language that has ever been invented, and perhaps, that ever will be invented. It has a sort of mathematical purity that I have not seen in any other programming language, and I have seen many other programming languages.

    I agree with the quote up above that LISP is the only programming language that is truely beautiful.

  104. Re: C for lispers by rsheridan6 · · Score: 1
    A real Lisper doesn't want to declare his variables.. this would start to look at least superficially like lisp if I had a clue about how to post code that indents properly on /.
    #define STMT(a) a;
    #define ARG(b) void* b
    #define DEFUN(b,c,d) void* b c { d return 0;}
    #define LETARG(a, b) void* a = b;
    #define LET(a,b) (a = (int) b)
    #define ADD(a,b) ((int) a + (int)b)
    #define MUL(a,b) ((int) a * (int) b)

    DEFUN (lisp, (ARG (arg1), ARG (arg2)),
    LETARG (x, 0)
    STMT (printf ("%d\n",
    (LET (x, (MUL
    (ADD (arg1, 2),
    (ADD (arg2, 4)))))))))
    --
    Don't drop the soap, Tommy!
  105. Practical Common Lisp... by Larsing · · Score: 1

    ...is a contradiction in itself ;-)

    --
    Ethics is what you say you do. Morals is what you actually do.
  106. Re:LISP isn't amazing. by boron+boy · · Score: 1
    There is a lot of writing about how great it is to have macro expansion at runtime... All of a sudden I realized I wasn't bound to passing values (or references to values, essentially the same thing) to a function. Now I could pass whole chunks of code around.
    Yeah, good luck debugging that shit.
  107. Re:My first exposure to list ( and a mirror of boo by Myolp · · Score: 2, Informative

    I had a similar experience with Common Lisp a couple of years ago. Fortunately I found Scheme, which made the whole functional programming paradigm a whole lot more enjoyable.

    http://www.plt-scheme.org/

  108. Re:My first exposure to list ( and a mirror of boo by Taladar · · Score: 1

    I read it a few weeks ago so I would've noticed if only examples were online.

  109. European by fvdham · · Score: 1

    I heard Lisp is USA and PROLOG is European.

    1. Re:European by cpghost · · Score: 1

      Yes, indeed. BTW, the whole Prolog syntax and inference engine have been rewritten in Lisp and look pretty good there too.

      --
      cpghost at Cordula's Web.
  110. Minor nit-pick by tez_h · · Score: 1
    Haskell uses lazy evaluation. Lisp uses strict evaluation unless you explicitly ask for lazy evaluation.
    Note that the opposite of 'strict' is 'non-strict' and the opposite of 'lazy' is 'eager'. Strict/non-strict is a semantic distinction. For example:
    my_func x y = x
    is strict on x, non-strict on y (in haskell, that is). Note, this is actually the definition of strict:
    my_func _|_ y = _|_
    my_func x _|_ = x

    (where _|_ is 'bottom', the undefined value of every type)
    Laziness/eagerness, on the other hand, refers to evaluation strategy. So, in haskell, non-strict semantics are achieved via lazy evaluation. Google for alternatives!

    -Tez

    --
    Haskell, the static-typed, lazy, polymorphic, programming language.
  111. Re:LISP isn't amazing. by Patrick+May · · Score: 1

    Common Lisp macros make debugging much easier because they reduce the amount of code that the original programmer has to write and that maintainers have to read. Patterns tend to exist in one and only one place instead of being scattered throughout as they are in Java and C++.

  112. Re:My first exposure to list ( and a mirror of boo by ajs · · Score: 3, Informative

    First off, let me say that I'm new to Haskell, and learning it, Python and (as of last night) Fortress at the same time, so I'm far from an expert.

    "Lisp can generally be made faster than Haskell"

    Certainly, and I'm not saying Haskell makes a good language for day-to-day coding. I'm just saying that it's a good place to learn functional programming.

    "Haskell uses lazy evaluation. Lisp uses strict evaluation unless you explicitly ask for lazy evaluation."

    For those who do not understand this point, it's worth going into. In C, when you say:

    c = foo() + bar();

    you call functioan foo and bar, add their results, and store that result in c. In Haskell a similar construct would store in c the information required to call foo and bar at a later time when/if you needed the value of c, but of course, if you just add c to another value, you just create a more complex result, you still don't invoke foo or bar.

    This is a very powerful concept, but can also lead to surprising results if you are used to programming in non-lazy languages.

  113. Static code verifications, anyone? by rroar · · Score: 1

    I am amazed nobody mentions the lack of static code checks in Lisp. There is this ongoing confusion about Lisp compilation: detractors say Lisp doesn't have compilation, then every pro-Lisper starts refuting that, "No, you moron, Lisp HAS compilation since ages".

    Well, nobody really cares if it is interpreted, compiled, JITed, you name it, as long as it is fast. But most programmers (and most important, MANAGERS) care about compilation as a way to minimize run-time errors. Heck, they love it, they are obsessed with it. Look at the extremes people go with strong-typing, building strongly-typed collections wrappers over the standard collections classes in Java and C#.

    While a code base with small incremental changes can do without static code verifications, lack of it makes team work so much harder. It feels absurd for modern programmers to use a language which cannot detect that a function is missing, unless you run the program. Or for which a string multiplication with a float is just fine.

    Paul Graham tells you that bottom-up programming is the best. Well, in Lisp you only have bottom up programming, because every code fragment has to be tediously verified by running it, or you are going to mispel a symbol, miss some files not included in the project, or God knows what.

    Add to that the extremely fragmented Lisp runtimes and development environments, and Lisp is disappearing.

    Which is a terrible shame, since Lisp has so much power and potential. I love Lisp. I would dump C#, Java and C++ for a good Lisp any day now, because they lack any serious meta-programming capabilities. We have to repeat the same stupid work again and again, because you can't build truly reusable code in these braindead languages.

    What we need for Lisp is a champion who would do for the Lisp concept what Java did for the C++ concept. Modernize it. Clean it. Implement it well and completely. Allow it to become the next-generation development system.

    It is going to happen, sooner or later. The "Intentional Programming" meta-programming environment Microsoft Research was developing some time ago looks for all intent (pun intended) like Lisp. Like a poor's man Lisp in fact, because those guys never understood that they needed a true computation model (which Lisp has), they were just adding features by the bunch, like they did in Windows.

    Don't hold your breath for this to happen.

    1. Re:Static code verifications, anyone? by Anonymous Coward · · Score: 0

      And yet, every attempt to do a statistical study on the subject shows just the opposite -- dynamically typed languages lead to fewer bugs and faster development of more correct code.

      Anyway, nothing prevents Lisp having static verification. Python (the CMUCL/SBCL compiler) does produce compile-time warnings for argument mismatches, attempts to add strings to numbers, etc.

    2. Re:Static code verifications, anyone? by Fahrenheit+450 · · Score: 1

      Can you cite any of those studies? I'm not saying they don't exist, I'm just saying I've never seen one and would like to.

      --
      -30-
    3. Re:Static code verifications, anyone? by omigod!kenny · · Score: 1
    4. Re:Static code verifications, anyone? by Tiny+Elvis · · Score: 2, Interesting

      You are complaining about dynamic programming in general. The compiler cannot always detect that a function is missing because the function does not even have to exist until runtime. I can build up functions in the program and call them. I could load a compiled file which contains the function at runtime. I could call a function by name, and that name may not be known until runtime.

      You claim to love Lisp, but I don't think you have really ever sunk your teeth into it, otherwise you would understand that what you gain with Common Lisp's dynamic nature makes up for what you lose in compile time error checking. I'm a big boy, I don't need the compiler holding my hand and telling me that function x is not found or that argument y is the wrong type. My code runs correctly because it is written correctly. I just use tools besides compiler type checking to get it to this state.

    5. Re:Static code verifications, anyone? by NetSettler · · Score: 2, Interesting

      There is quite a lot I could say about this, but I'm going to focus here on just one point:

      Managers would care a lot less about handling runtime errors if static languages didn't just plain segfault when they get them. Error handling in non-Lisp languages is so bad that of course people outside of Lisp are obsessed with handling errors. Even Java, which drew from Lisp in its design, failed to pick up the notion of "restarts" and so only has the throw-style environment=wrecking error handling. That is severe and it's no wonder managers think it matters.

      Also, the number of NULL problems you get in many static languages all by itself makes me distrust the confidence factor that managers put in static compilation. The number of wrong-type-data problems I've seen in Lisp pales by comparison to this one unchecked "detail" in these static languages.

      And besides, there are other kinds of errors you can get that are just as severe but not as easily seen as type errors, and that lots of times people in static languages don't check for because they're so relieved their program runs at all. While Lisp programmers, not having this safety net, write much better tests. Tests for things other than just type match and nullness, I mean. Tests to do things like see whether the answer is right--because it's so much more easy in Lisp to represent and manipulate data that it's much easier to write GOOD test cases.

      I think the process of managing Lisp projects is simply different than managing C++ projects There are a lot of details that they should account for quite differently if they want a successful outcome. This is only one of them. The paradigm shift is noticeable, I'll grant you that. But I'm not sure fixing it by making Lisp just do what other langauges do is the right fix.

      --

      Kent M Pitman
      Philosopher, Technologist, Writer

    6. Re:Static code verifications, anyone? by Anonymous Coward · · Score: 0

      Or for which a string multiplication with a float is just fine.


      >(shadow 'cl::*)
      T

      ;; Let's define our own *
      >(defmacro * (a b)
      (when (or (stringp a)
      (stringp b))
      (error "Can't multiply strings!"))
      `(cl:* ,a ,b))
      *

      ;; Works like the regular * (except that ;; it only takes two arguments, but we ;; could easily fix this)
      >(* 2 3)
      6

      ;; Let's try to use it...
      >(defun test (x)
      (* x "abc"))
      TEST

      ;; Compile-time type check!
      >(compile 'test)
      ; While compiling TEST:
      Error: Can't multiply strings!
    7. Re:Static code verifications, anyone? by Fahrenheit+450 · · Score: 2, Interesting

      Well, it appears to be worth next to nothing. What we have there is some guy looking at a few of his projects and deciding he doesn't need static type checking. And it's not completely clear if he makes this claim because he's not making type errors, or because his type errors are being caught by his unit tests.

      He also makes a somewhat odd set of claims that:
      a) He doesn't make type errors.
      b) Dynamically typed code is easier to develop because he doesn't have to deal with build time type issues.

      But... if he wasn't making type errors, then why would he have build time issues with static type-checking? I suppose I might be missing something, but what?

      In any case this isn't even up to the fuzzy quality of Haskell vs. Ada vs. C++ vs. Awk vs. ... An Experiment in Software Prototyping Productivity (PDF) or the less fuzzy Are Ours Really Smaller Than Theirs? (PDF). It's just some guy and his hunch...

      --
      -30-
    8. Re:Static code verifications, anyone? by Anonymous Coward · · Score: 0
      By "build time issues" he probably means tweaking type declarations to prove to the compiler that the code is type-correct, when in fact without the type checking it still would have worked.

      Interesting that he advocates extensive unit tests but not explicit typing, when both boil down to adding redundant information to the software in the hope of detecting inconsistencies, and types double as optimization hints (while unit tests are pure overhead).

    9. Re:Static code verifications, anyone? by cstacy · · Score: 1
      It feels absurd for modern programmers to use a language which cannot detect that a function is missing, unless you run the program. Or for which a string multiplication with a float is just fine.
      • Lisp complains at compile-time when you write a call to a non-existant function.
      • Lisp complains at compile-time if it can prove that you are passing an invalid type. (But since it's dynamic, this applies only to built-in functions and user functions that have type information on them. It does not apply to calls where the function to be applied is computed dynamically, of course.) Good Lisp compilers do some pretty fancy type inferencing.
      Your suggestion that your Lisp applications will compile without any problems even if you have misspelled function names, forgotten to include necessary source files, or that no type checking has been done at all, does not match reality.

      What is absurd is for modern programmers to use a language which cannot detect that a function might be supplied later in the development process. Or for which a data type has not yet been cast in stone.

      Furthermore, it is absurd to use languages in which the program will crash in a useless fashion (eg. dump core) when something goes wrong, rather than being able to detect that something has gone wrong and provide an easy way to implement some (automatic or manual intervention) recover strategy. One reason that Lisp is good for certain classes of critical programs is because it has dynamic features like that.

      There are some ideas from other languages that could be added to Lisp (layered into it) to make it even better, but let's not imagine crazy things like Lisp not knowing whether or not all your program is present at compilation time.

      You also suggest that Lisp is strictly "bottom up" because you have to test each component before proceeding. Nothing could be further from the truth.

    10. Re:Static code verifications, anyone? by cstacy · · Score: 1
      But... if he wasn't making type errors, then why would he have build time issues with static type-checking? I suppose I might be missing something, but what?
      Without reading the study, I would suppose that his "build-time" issues were that he was unable to compile his program without first having to waste time running around making all the type declarations first. When you're experimenting with the design, that's a lot of overhead. (This is the philosophical departure from those who favor static languages.)

      As you really nail things down, as a final consistency and safety check on your code, you might like to go back and cast some things in stone and do some more static type-checking. (This would be done much later in the development process than you might think.) You could easily add this feature to Lisp, by the way, without changing the existing language. I think this could be done with some relatively simple macros (you've already got access to features in the compiler such as code walking, call trees, etc.) Lisp never forces you to do anything like that, and in practice, Lisp programmers find that by the time they get to that point, it's not needed. That is, the anecdotal claim is that their programs don't have any type bugs.

      My personal experience over the years is that the large Lisp programs that I've worked on have not had any type bugs, either. (Well, of course I mean that in years of continuous execution by many users, no such errors manifested themselves.) The small programs didn't have type bugs either. YMMV.

      Also, Lisp does allow you to make type declarations on your functions, and good Lisp compilers can do considerable type inferencing and checking.

    11. Re:Static code verifications, anyone? by Fahrenheit+450 · · Score: 1

      Without reading the study, I would suppose that his "build-time" issues were that he was unable to compile his program without first having to waste time running around making all the type declarations first. When you're experimenting with the design, that's a lot of overhead. (This is the philosophical departure from those who favor static languages.)

      So use a decent language that offers type inference, like OCaml or Haskell and this consideration goes away (almost) entirely, you still have static type checking, and I remain baffled by his statements. If that's the source of his issues, it's a bit like slamming dynamically typed languages for being so slow because TCL works at a glacial pace..

      --
      -30-
    12. Re:Static code verifications, anyone? by be-fan · · Score: 1

      Um, what the heck are you talking about? Common Lisp does have static code verification, through type declarations. The general development pattern of Lisp code is to develop the code bottom-up, in a dynamic manner, then introduce type declarations in certain places to either enforce contracts or improve performance. If your code is properly modularized, then contract enforcement should only really be necessary between modules.

      And it's not that Lisp runtimes cannot detect that a function is missing (they can, and good environments will warn you that it is), it's that Lisp allows you to create functions and classes at runtime, so the compiler has no way of knowing whether the function will exist in the future. And string multiplication with a float is never fine in Lisp: if you do the type declarations, the compiler will give you an error at compile time, otherwise, it will give you an error at runtime.

      --
      A deep unwavering belief is a sure sign you're missing something...
    13. Re:Static code verifications, anyone? by be-fan · · Score: 2, Interesting

      It's not an odd claim to say that he doesn't make type errors. Generally, if you're rigorous about the design of your system, the types fall out naturally. It's also important to note that Lisp code generally uses far fewer types than Java code. Java code makes a new type for everything, because that's the only real expressive mechanism Java has --- classes. Lisp is far more expressive, so types are generally created when the problem domain requires it. Thus, it's much more clear and obvious what the types of an expression are at any given point, which minimizes errors.

      Ask a Python programmer how often he makes type errors. After the first few weeks of using Python, I realized I very rarely made type errors. That's partly because my code was much simpler, shorter, and more logical than the equivalent C++ or Java code.

      As for (b), the insight your missing is type checking is fundementally a way of declaring a contract. The problem is that C++ and Java force you to declare that contract whenever you use a variable, instead of just when it makes sense. Consider a producer/consumer problem where the product is passed between some number of intermediaries. Logically, type contracts only need to be enforced between the producer and the consumer --- the intermediaries don't care what the types are. In C++/Java, you can't do that. You're either forced to pick a type, and then forced to change all the intermediaries when the producer/consumer changes, or you're forced to create yet another class heierarchy, just to insulate the intermediaries from those changes. That's why Java code tends to have such overengineered heierarchies --- the language prevents the programmer from making more rational ones. Think of why every popular Java IDE has a tool to automatically 'refactor' the code when a type changes. If you think about it, it's an enormous hack. It's just an automated way to do grunt-work that is only necessary because the language is too limited to express what the code really needs to say.

      --
      A deep unwavering belief is a sure sign you're missing something...
  114. The world has moved on. by Anonymous Coward · · Score: 0

    All the exciting stuff these days is happening in modern languages like Haskell. Lisp is old and tired - let it die its natural death, grieve for it but briefly, and then open your eyes to the possibilities of the 21st century.

    I'm quite serious. Lisp has some very nice things about it. But dynamic code leads to unsafe code, and Lisp's very basic syntax leads to a tendency to rely too much on heterogenous lists as a solution to everything. Modern languages like Haskell make it trivial to build complex trees and graphs, and let you solve problems with just as little code and just as much reuse as Lisp - and yet it's also easy to prove that your code is correct!

  115. Re:My first exposure to list ( and a mirror of boo by Anonymous Coward · · Score: 0

    Maybe they don't contain the book itself, but they do contain a copy of it.

  116. engineering tradeoffs by cahiha · · Score: 2, Insightful

    Everything else is just now catching up. Evidence all the effort to fold in Lispy features into Python, Perl, Ruby, etc., etc.

    Engineering is about making tradeoffs--something that the designers of Lisp did not understand. If you try to create a completely general language with completely general language constructs, you try to standardize it, and you try to also make it fast, something has to give. And the thing that gives is development time.

    Python, Perl, and Ruby can afford to implement lots of Lispy things because they aren't also trying to create a language standard and efficient, natively compiled implementations. Java is also implementing lots of Lisp things, but it makes other tradeoffs (which result in it being more cumbersome in some ways).

    While Lisp Just Works.

    That's a stupid statement: nothing "just works" for everybody. And CommonLisp had lots of problems: scoping, naming, reflection, and code generation are all pretty shaky in CommonLisp. Its standard library also had lots of important omissions. If CommonLisp "just works" for you, consider yourself lucky. Frankly, I think the number of people for whom, say, Python "just works" is considerably larger than the number of people for whom CommonLisp "just works".

    1. Re:engineering tradeoffs by Pete · · Score: 2, Insightful
      Engineering is about making tradeoffs--something that the designers of Lisp did not understand.

      Yeah, it's a terrible shame that all those incredibly intelligent mathematicians and engineers behind Lisp didn't have cahiha to advise them about the concept of engineering tradeoffs.

      Java is also implementing lots of Lisp things, [...]

      Lots of Lisp things??? Tell you what. How about you tell me just two. And you can use "garbage collection" if you can't think of anything else, but I'll think it pretty lame :).

      The things I generally think of when I think of Lisp (Common Lisp or Scheme or other forms) includes REPLs, macros, functional-style programming, macros, incremental/optional compilation, macros, optional/dynamic typing, macros, closures and macros. Oh, and (occasionally) continuations. Java doesn't come close to having any of those, last I looked.

      And CommonLisp had lots of problems: scoping, naming, reflection, and code generation are all pretty shaky in CommonLisp.

      Okay, try to name (or point to an article online that names) something wrong (or suboptimal, etc.) with the Common Lisp implementation of scoping, naming, reflection and code generation. Seriously, I'm really interested. I'm not an expert on Common Lisp myself, and all I'd read suggested that Common Lisp was actually far superior to any other programming language re: reflection and code generation (and I'd never heard of any problems in the way it handles scoping or naming).

      Re: the standard library having some important omissions, well, you have more of a point there. Lacking a semi-standard free implementation of a GUI has been a bit of a problem for a while, but it's debateable whether such a thing belongs in a standard library in any case. Same with other practical issues like database connectivity.

      Some languages (eg. Java, Python) define rather a lot of stuff in their "standard" library. Some (eg. Scheme) define very little. Common Lisp is somewhere between the two extremes. There are usually libraries to do most things you might want (especially for the more popular implementations), but they're not necessarily standardised.

      Frankly, I think the number of people for whom, say, Python "just works" is considerably larger than the number of people for whom CommonLisp "just works".

      Quite likely. No argument there. But I'd probably suggest that the average (serious) Common Lisp application is significantly more sophisticated and powerful than the average (serious) Python program - mainly because Common Lisp just has a lot more raw power than Python.

      To borrow an apt quote from Kenny Tilton, one of the denizens of comp.lang.lisp: "Lisp supports meta-solutions which not only pay off more and more in the long run, but which also require greater design effort up front. If anything a Lisper tortoise seems to be going slower than the hare because the tortoise is still at the starting line building a rocket sled."

    2. Re:engineering tradeoffs by Anonymous Coward · · Score: 1, Informative

      Incremental compilation in the lisp sense has always been possible in Java, you're just slamming it because it's not done the same (learn how to use a classloader and maybe you'll understand.) Java's (existing now and always has) version of incremental compilation works quite well, beats the hell out of C#, and any language that compiles to jvm bytecode has the same capacity.

      REPL could be done in Java, but few people seem to care to; maybe because not everybody likes to develop in such an environment. It has nothing to do with Java's capabilities, nor indeed does it have anything to do with lisp as a language, but rather a development approach.

      And Java lacks macros because, well, c-style macros tend to blow goat and are bad from an object-oriented standpoint. Macros in the lisp sense seem like they would be difficult to add to Java, but I'm uncertain as to how they would affect OO-cleanness.

    3. Re:engineering tradeoffs by sketerpot · · Score: 3, Informative
      Okay, try to name (or point to an article online that names) something wrong (or suboptimal, etc.) with the Common Lisp implementation of scoping, naming, reflection and code generation. Seriously, I'm really interested. I'm not an expert on Common Lisp myself, and all I'd read suggested that Common Lisp was actually far superior to any other programming language re: reflection and code generation (and I'd never heard of any problems in the way it handles scoping or naming).

      CL has some problems with the Meta Object Protocol (MOP), which is used for reflection and to modify the object system. It's not standard, but it's supported by all major Lisp implementations---and they usually have small differences, most prominently what package they put it in. Is it in the MOP package? Or perhaps the SB-PCL package? In order to make portable code that uses the MOP, you need a compatibility layer like Closer or MOPP or CLIM-MOP.

      That said, once you have all the compatibility code in place you can do amazing things with the MOP. I co-wrote a graphical object inspector that made heavy use of Lisp's introspection abilities, and Pascal Costanza added Aspect-oriented programming to Common Lisp with AspectL.

    4. Re:engineering tradeoffs by cahiha · · Score: 2, Interesting

      Yeah, it's a terrible shame that all those incredibly intelligent mathematicians and engineers behind Lisp didn't have cahiha to advise them about the concept of engineering tradeoffs.

      They did, actually. I told them (as did lots of other people) even back when Lisp was more hyped up than Java has ever been and people were dropping $100k for a single Lisp-based workstation. They just weren't listening. The result of their lack of good engineering sense and arrogance was the demise of Lisp and the predictable (and predicted) 20 years of dark ages of C/C++ programming. It just boggles the mind that 20 years later, people like you still don't get it. I guess hindsight isn't 20/20 after all.

      I won't even say anything more about Java, since I don't like the language, other than that you seem to know very little about its actual capabilities. For Python vs. Lisp, read Norvig's article.

    5. Re:engineering tradeoffs by Phil+Gregory · · Score: 1
      and I'd never heard of any problems in the way it handles scoping or naming

      Well, one thing that comes to mind is namespaces. For one, the fact that variables and functions share namespaces (especially given that functions are objects, so you have to treat, say, myfunc differently depending on whether it was defined as (defun myfunc () ...) or (setf myfunc (lambda () ...))). For another, it can be difficult to find appropriate functions for your purpose, since the common-lisp package is so large. (I find myself referring to the appendix in Paul Graham's ANSI Common Lisp a lot.)

      I'm not an expert, though, either. I love the language and use it when I can, but it doesn't have the same teeming horde of add-on packages that languages like Perl or even Python have. (Though I do as much database stuff in Common Lisp as I can, because CLSQL is wonderful.)


      --Phil (Perhaps someday I'll be a Real Boy ^W^W Lisp Hacker)
      --
      355/113 -- Not the famous irrational number PI, but an incredible simulation!
    6. Re:engineering tradeoffs by Pete · · Score: 1
      Incremental compilation in the lisp sense has always been possible in Java, you're just slamming it because it's not done the same (learn how to use a classloader and maybe you'll understand.)

      Okay, I'm quite willing to admit I wasn't aware Java could do incremental compilation of any kind - I thought you just had to compile a Java source file into a JVM bytecode file (or machine code via something like gcj) and that was it. But I guess it depends on what you define as "incremental compilation". Now I think about it, the term is pretty vague - I was thinking of an environment where you can have interpreted code and then arbitrarily decide to compile a function here or there. And that's a little too closely linked to the REPL concept as well as the amiable coexistence of interpreted and compiled code... so it's not really possible to evaluate Java on those terms.

      I'll also cheerfully admit I don't know how to use a Java classloader - I haven't written anything serious in Java for about six years. But from what I remember, I thought the classloader was more of an incremental linker than a compiler.

      REPL could be done in Java, but few people seem to care to; maybe because not everybody likes to develop in such an environment.

      I suspect it's more that Java's just not very well suited to that kind of try-stuff-out-in-bits-and-pieces environment. You're right that it's not anything super-duper amazing, and it should be possible to have a Java REPL, but I think it'd be awkward and probably wouldn't be very effective/useful (as, for comparison, it is for Python).

      Macros in the lisp sense seem like they would be difficult to add to Java,

      As far as I understand it, it wouldn't even be possible. The whole power of the Lisp macro system is due to the s-expression syntax (regular and unambiguous structure, code is data is code, etc.).

      I've heard that some non-sexp languages can approximate Lisp-style macros (eg. Dylan), but they don't compare to the real thing.

    7. Re:engineering tradeoffs by Pete · · Score: 1
      They did, actually.

      *blink* Okay, I'm intrigued. You were involved in the Common Lisp standardisation process? Or something related?

      The result of their lack of good engineering sense and arrogance was the demise of Lisp and the predictable (and predicted) 20 years of dark ages of C/C++ programming. It just boggles the mind that 20 years later, people like you still don't get it.

      I guess all the people like me just aren't very bright. Unlike you :).

      Look, I know it's tempting to think that you had the answer and everything would be good if they'd just listened to you... but have you ever considered that there might be more than one reason for the so-called "demise" of Lisp?

      Perhaps quite a large number of reasons?

      I won't even say anything more about Java, since I don't like the language, other than that you seem to know very little about its actual capabilities.

      Ah good. Always nice to get in a little snipe, isn't it? Especially over something so trivial and pointless. God, I love it... it makes me feel ALIVE! :-)

      It's also a very nice cheap way of avoiding answering the question (said question being "tell me just two 'Lispy' things that Java is implementing"). Which is a pity, as I didn't just ask it as a snide way of suggesting that you were talking out of your arse (though that was a large part). I was actually really interested to hear if there were any new Lispy features scheduled for Java (or indeed any old ones that I hadn't heard of).

      Whatever else you or I might say about Java, it has a lot of mindshare - and the horrifying possibility that I might one day use it again might be slightly less horrifying if I knew there were some Lispy features being added to the language. If anyone else reading this can guess what cahiha might have been referring to, please do let me know. Thanks.

    8. Re:engineering tradeoffs by Pete · · Score: 1

      Okay, cool, thanks for that information (especially the links). CLOS and/or the MOP is one of the aspects of Common Lisp I haven't played with at all, so I know little or nothing about it. Mind you, I've mainly experimented with SBCL (and a little with CLisp), so I haven't had to deal with those kind of subtle portability problems as yet.

    9. Re:engineering tradeoffs by OOGG_THE_CAVEMAN · · Score: 1

      OOGG think answer quite accurate and informed, but misleading to novice.

      Problem of non-standard naming for MOP pale in comparison to OOP architecture so stone-age that have no MOP at all. Or language like C++ that provide template "solution" which is worse than problem.

    10. Re:engineering tradeoffs by sketerpot · · Score: 1

      If you want to learn how to use the MOP, there's a tutorial here, which is continued here.

    11. Re:engineering tradeoffs by cahiha · · Score: 1
      *blink* Okay, I'm intrigued. You were involved in the Common Lisp standardisation process? Or something related?

      I was a customer and fairly heavy user of Lisp. I also contributed to several Lisp implementations and developed two Lisp interpreters myself.

      I guess all the people like me just aren't very bright. Unlike you :).

      It has nothing to do with being "bright"; as a serious user of a language and tool, you know whether it's working for you or not, and as someone who has worked on implementations, you know what is possible.

      I wasn't exactly alone in my unhappiness with CommonLisp, which is why you got so many "alternative" Lisp efforts (Scheme, extended Scheme, Dylan, ISO Lisp, etc.), and why lots of people stopped using Lisp in the decade from the mid-80's to the mid-90's.

      Part of the problem was that Lisp was designed for AI, but AI had moved on and Lisp hadn't changed and adapted to support its new needs. At this point, Python and C++ are actually far better languages for modern AI than Lisp.

      Look, I know it's tempting to think that you had the answer and everything would be good if they'd just listened to you... but have you ever considered that there might be more than one reason for the so-called "demise" of Lisp?

      Saying "if you don't do X, you will fail" is not equivalent to saying "if you do X, you will succeed". Better engineering would have been necessary, not necessarily sufficient.

      Ah good. Always nice to get in a little snipe, isn't it? [...] might be slightly less horrifying if I knew there were some Lispy features being added to the language.

      It's not a "snipe", the features are just so blatantly obvious, and they have been there for more than half a dozen years. That's no coincidence either: a lot of ex-Lisp, ex-Smalltalk, and ex-Self people have contributed to Java:
      • REPL: beanshell.org (used by DrJava and other IDEs), Jython, or a bunch of other interpreted languages
      • incremental development: standard feature in many IDEs (modify the running program), supported via standardized debugging APIs
      • dynamic typing: cast to/from Object, class attribute, etc.
      • reflection: java.lang.reflect
      • dynamic code generation: via class loaders (excellent support libraries)
      • functional programming: notationally less convenient, but effectively available via nested classes and used in new collection classes
      • macros: hygienic macros have been proposed for Java and a design has been worked out (maybe even an implementation) but deliberately left out
      • continuations: not part of CommonLisp and not part of Java either
      So, here is where we are today: there are some people still fanatically devoted to CommonLisp; as long as they are vocal and as long as the CommonLisp standard is perceived as "the" Lisp standard by the outside world, no Lisp is going to make it. Scheme is good for what it is, and there are some excellent implementations, but it is too limited for real-world development, although an extended Scheme standard might have a chance. ISO Lisp is what CommonLisp should have been in the 1980's, but it is in serious need of updating (ISO Lisp might be the best starting point for a modern Lisp).

      OTOH, the JVM and CLR are excellent runtimes, well defined, with multiple implementations, languages that many programmers feel comfortable with, and lots of dynamic language implementations running on top of them (e.g., Python, Smalltalk, and Scheme) that interoperate with those languages.

      What we need is for the CommonLisp and Scheme folks to shut up about their old standards and for a bunch of credible language designers to create a new Lisp. But that will probably take another 20 years, when the people who inflicted CommonLisp on us are finally retired. And by that time, programming will hopefully neither consist of pointer manipulation, nor of recursive functions over conses anymore, at least if I have anything to do with it. I would have much rather used a good standard Lisp than the JVM as the basis for my work, but Lisp just wasn't up to it.
    12. Re:engineering tradeoffs by Anonymous Coward · · Score: 0
      I'll also cheerfully admit I don't know how to use a Java classloader - I haven't written anything serious in Java for about six years. But from what I remember, I thought the classloader was more of an incremental linker than a compiler.

      So, you cheerfully badmouth another language without having used it in six years and without knowing much about it? To hell with all the people who have worked on it or rely on it, you have your opinion, and you are going to make up any story that suits you in order to support it.
      As far as I understand it, it wouldn't even be possible. The whole power of the Lisp macro system is due to the s-expression syntax (regular and unambiguous structure, code is data is code, etc.).

      Hygienic macros would work just fine in Java and they don't require manipulating sexprs. CommonLisp's macros are considered obsolete even by many Lisp developers.
    13. Re:engineering tradeoffs by Anonymous Coward · · Score: 0

      Quite to the contrary: the flexibility of the MOP is a major problem for real-world development. Languages like Java are successful because they picked a simple object model.

    14. Re:engineering tradeoffs by OOGG_THE_CAVEMAN · · Score: 1

      OOGG never use MOP, still can program CLOS just fine. MOP exist for specific reason, not everyday development.

      If not need super OOP powers granted by MOP, OOGG suggest not use them. Java suggest nobody *ever* need super powers. Obviously untrue.

  117. I don't think so by cahiha · · Score: 1

    Based on his past record and interests, I wouldn't get my hopes up. Graham represents the attitudes and narrow focus that has turned off so many people from Lisp in the first place. And for a language designer to comment that he "intends it to be a hundred-year language" is just moronic and show a complete lack of long-term perspective.

    The best attempt at a new Lisp I have seen is the Lisp Universal Shell (lush), which, despite the name, is actually a high-performance Lisp implementation.

  118. Re:My first exposure to list ( and a mirror of boo by Anonymous Coward · · Score: 0

    Huh. I find haskell syntax really amazingly ugly: while I'm interested in FP, one of the main reasons I stick with lisp is because of its clear and simple syntax. I know one _can_ write clear (to my eyes) haskell - but all the idiomatic haskell code I see on the net is using haskell's obnoxious whitespace-sensitive 2D syntax, and, seeing as programming is 90-something % reading existing code, I just can't stand Haskell.

  119. Re:My first exposure to list ( and a mirror of boo by Bloater · · Score: 1

    > Haskell has significant whitespace, like Python. Lisp doesn't.

    Significant whitespace in Haskell is optional. If you miss out the braces, the compiler "inserts" them according to the whitespace. If you put them in in the first place, whitespace doesn't matter.

  120. God wrote the world in Lisp by Anonymous Coward · · Score: 0

    http://www.songworm.com/lyrics/songworm-parody/Ete rnalFlame.html
    (There's an MP3 out there, but I can't find it)

  121. LISP is pretty, but also tricky in practice... by j.leidner · · Score: 1
    1) macros will blow your mind. Read Paul Grahams' 'On Lisp'

    Quite right, LISP's parentheses blow everybody's mind, including Paul Graham's.

    From Graham's "On Lisp" errata site:
    p. 85. `(,a ,(b `,c))) has an extra close paren.

    (((I) (wonder) (why)))
    ;-)

    --
    Try the Nuggets mobile search engine in natural language - free across the UK

  122. Oh things would have different alright... by Viol8 · · Score: 1

    You'd have needed a supercomputer just to run a hello world program. Sorry to burst your bubble but C became big because it was fast, flexible and could code to the metal. WHen you're working with an 8 bit 4Mhz processor thats a *teensy* bit more important than having a design framework for your program that you could have impressed other fellow Ivory Tower inhabitants with when the wind wasn't blowing from the direction of Smalltalk Island. In fact if people still bothered to write efficient code as opposed to code that ticks all the design pattern boxes we might not need GHz processors to run a friggin word processor!

    1. Re:Oh things would have different alright... by amightywind · · Score: 1

      WHen you're working with an 8 bit 4Mhz processor thats a *teensy* bit more important than having a design framework for your program that you could have impressed other fellow Ivory Tower inhabitants with when the wind wasn't blowing from the direction of Smalltalk Island.

      Then keep your face emersed in the primodial ooze and use C to program your wristwatches. But if the art of computer program is to ever advance programmers need to embrace good ideas, not broken, confused methods that are 'good enough'.

      --
      an ill wind that blows no good
    2. Re:Oh things would have different alright... by Viol8 · · Score: 1

      A computer program isn't a work of art. Its solution to a problem and should be made as efficient and quick as possible for the users. Its attitudes like yours that have given rise to the sluggish crap that passes for software today.

    3. Re:Oh things would have different alright... by brpr · · Score: 2, Insightful

      No, what's given rise to the sluggish crap is implemeting everything in C. Take Gtk, which would be much faster if it was written in a language which actually supported its object model. As it is, the code's clogged up with kludges to string together some kind of OO support and it's slower than it would be if it had been written in C++.

      And, although I don't expect you'll listen, Lisp is an efficient language. It compiles to fast machine code.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    4. Re:Oh things would have different alright... by metamatic · · Score: 1

      Believe it or not, there are Lisp systems for 4MHz 8 bit processors. I mean, what do you think they were using in the 50s when the language was invented?

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    5. Re:Oh things would have different alright... by Gorbag · · Score: 1
      A computer program isn't a work of art.
      Methinks you've been reading the wrong computer programs.
      --
      -- I speak only for myself
    6. Re:Oh things would have different alright... by Anonymous Coward · · Score: 0

      The kruft that means you require a supercomputer to run a word processor comes from the nature of C that makes it impossible to analyse and therefore reorganize. That means, after years of kruft building up something like Word turns into a klunky beast and yet something written from scratch can be so much more efficient.

  123. Exceptions. Big deal. Just glorified gotos. by Viol8 · · Score: 1

    No doubt this will get modded down by some pimply faced moderator straight out of 00 101, but i does make me laugh when on the one hand people extoll the virtues of exceptions but on the other damning others who uses gotos. If they had a clue about programming paradigms they'd realise they're pretty much the same thing and can both lead to a type of sphagetti code where you cant easily follow the flow of control.

    1. Re:Exceptions. Big deal. Just glorified gotos. by Tiny+Elvis · · Score: 1

      Are you saying that robust exception handling is a bad thing?? I hope not.

      Errors cause the flow of control to go wrong, exception handling lets you manage this.

    2. Re:Exceptions. Big deal. Just glorified gotos. by Viol8 · · Score: 1

      Exception handling is a no brainer solution to hard problems. DOn't know what to do with this error? Oh lets just do a goto back up to some higher function and hope for the best. Gimme a break.

    3. Re:Exceptions. Big deal. Just glorified gotos. by Tiny+Elvis · · Score: 1

      What the hell are you talking about? You clearly have no knowledge of how exceptions/conditions are handled in Common Lisp. Possibly any other language either.

  124. /lack/ of long-term perspective? by Szplug · · Score: 1

    The notion of a hundred year language comes from the fact that some languages have been around for 50 years already, and there's little sign that they won't last another 50 (Fortran eg is still being written, and has a large code base as well). It's not hubris that makes him say his language will be around that long, there's a good chance of it. And since that's the length of time you're talking, it's worth a couple of years to get it right.

    But, thanks for the link, I'll have to check that out.

    --
    Someday we'll all be negroes
  125. We can get close... by Just+Some+Guy · · Score: 1
    I use Python for almost all new development. Why? Because it offers at least a bit of Lisp's functional goodness, but is similar enough to the other common programming languages that other people actually use it. If I were writing purely for my own entertainment without having to interact with others, I'd probably take a closer look at Lisp. However, that's a luxury I can't afford right now and I've therefore had to pick something a little more palatable to the people around me.

    That doesn't mean that I can't use some of its concepts, though. Our company's application server (running on Zope) makes heavy use of passing functions here and there ("report generator, make this data into a PDF, and use this dictionary of lambda functions to format the data in it and use this other function to generate the filename based on the results"). With Python, we have the option of using baby steps that my eventual replacement can understand, rather than having to find someone willing to jump directly into a Lisp codebase with no prior experience.

    Is that the ideal? No, but it's certainly not awful, either.

    --
    Dewey, what part of this looks like authorities should be involved?
  126. Re:someone ought to update and simplify the langua by Tiny+Elvis · · Score: 1

    How specifically are function cells and arrays poorly designed?

  127. Lisp's problem by GCP · · Score: 2, Interesting

    If you are going to use Lisp for anything practical, you have to deal with the fact than any programming platform you choose is a combination of base language, libraries, dev tools, documentation, implementations (at several levels), other programmers, etc.

    The Lisp aspect that Lisp lovers (like me) tend to like most is in the most fundamental notions of the "idea of Lisp". A very small toolbox of ideas that are combinable in an amazingly flexible way, allowing a layering of totally customizable abstractions. The power of such an approach is intoxicating, leading to a real love of the language for so many people.

    The basic ideas aren't the problem. They are so pure and simple that they are almost timeless, like a branch of mathematics.

    Lisp's problem is that those ideas don't exist in a vacuum. When you need to use Lisp for practical purposes, you have to deal with all the other aspects that come along with a platform, and those are stuck in a time warp.

    While the fundamental ideas of Lisp are as fresh today as ever, fresher than the ideas of more mainstream languages as any Lisper will tell you (endlessly), the non-fundamental aspects of Lisp, such as the myriad design decisions in the Common Lisp version of Lisp, reflect design decisions optimized for the constraints of the computing industry of the Apollo Space Program era.

    The fresh, powerful, timeless, amazing ideas of Lisp are inseparably intertwined with obsolete baggage (technical and marketing) that users of mainstream languages don't want to, and don't have to, deal with.

    A New Lisp, where the timeless aspects are retained, but the other design and marketing decisions reflected today's circumstances could be terrific. Paul Graham has been talking about that for years now, essentially preempting anybody else by increasing their risk of irrelevance while refusing to deliver so much as an annual status report.

    Any mention of a New Lisp to Common Lispers is like throwing water on a cat. They hiss and shriek that Common Lisp is so close to perfection that nothing needs to be changed beyond "a few libraries". It seems they have to convince themselves of that because there is so little life in the Lisp community that no one CAN produce a new Lisp. They're stuck with the old one, so they elevate it to almost the status of a religion. Those who require a more modern complete system leave Lisp (for inferior languages in superior systems), and only the True Believers remain to console one another and hiss at outsiders who ask the natural questions about the emperor's wardrobe.

    What a mess....

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
    1. Re:Lisp's problem by Da+VinMan · · Score: 1

      I'm extremely tardy to this discussion, but I feel it's worth pointing that if any other language out there supported true macros, then Lisp would most likely be dead by now.

      Now, I don't see how any other language (that isn't Lisp based itself) could actually support true macros without adopting the same syntax Lisp uses.

      But then it would be "Lisp based" (at least superficially) and then you're back where you started (i.e. it's impossible to invent something better than Lisp because Lisp is perfect already).

      As someone who is now endeavoring to learn Lisp for fun (and who knows, maybe profit someday), this point has been made very clear to me by what I've been reading.

      So, on that note: Do you know of a language besides Lisp that supports true macros? If so, I'll be there in a heartbeat as I don't really want to associate with such a conspicuously smug community if I can help it. If not, then I guess that's that.

      Thanks in advance for your response.

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    2. Re:Lisp's problem by sleepingsquirrel · · Score: 1
      Now, I don't see how any other language (that isn't Lisp based itself) could actually support true macros without adopting the same syntax Lisp uses.
      You might like to check into the Joy language. It may not have macros, but its syntax (even simpler than lisp!) make meta-programming a breeze. Also, the Forth guys don't think programs that write programs are anything new.
    3. Re:Lisp's problem by GCP · · Score: 1

      Do you know of a language besides Lisp that supports true macros? If so, I'll be there in a heartbeat as I don't really want to associate with such a conspicuously smug community if I can help it.

      Great question & comment. Few serious developers are willing to put up with a developer community as dysfunctional as comp.lang.lisp if they don't have to, and these days nobody has to. Common Lisp seems to be an evolutionary dead end.

      I can't imagine any other languages with the flexibility of Lisp that aren't just another form of Lisp, such as Common Lisp, Scheme, Arc, etc.

      Common Lisp is a fossil. Scheme is a bunch of science projects by people who seem to want to know everything about programming languages except how to make them useful for real production. Arc is a collection of ideas to talk about at conferences and apparently nothing more.

      Python has the right stuff from every perspective EXCEPT the language itself, where it is a faint shadow of the power of Common Lisp. I use it all the time, but it is a huge frustration to have such a limited language after using a real Lisp. The comp.lang.python community is a breath of fresh air after the misanthropes at comp.lang.lisp.

      You may just have to use interesting languages like Lisp or Haskell for fun, and live with using mainstream languages for real work, applying techniques you learned from the more interesting languages when you can.

      --
      "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
  128. Is anyone else _still_ waiting... by Anonymous Coward · · Score: 0

    for an example of something one can do in lisp that one cannot do in C++?

  129. Python now has powerful multimethod capabilities by jlandahl · · Score: 1

    Common Lisp is the only industry language which has full-featured multimethods in its object system (CLOS).

    Though it is still somehwat alpha, there is an implementation of multiple dispatch for Python which goes beyond CLOS by also providing predicate dispatch. Unfortunately there isn't much in the way of documentation yet, but try these links for starters:

  130. MetaOCaml by sleepingsquirrel · · Score: 1
    Really? Which functional language has macros?
    You might also like MetaOCaml and MetaML.
    1. Re:MetaOCaml by Ulrich+Hobelmann · · Score: 1

      Thanks for the information, but still I find Lisp's syntax and the combination of all its features the most convenient...

      I did some coding in SML, but in the end I prefer imperative programming. Maybe I'll take another look at FP later.

  131. Polymorphism by Anonymous Coward · · Score: 0

    Of course, your use of macros above is also known as polymorphism in the rest of the computer science world (which you don't need macros for).

  132. Talking to the OS by Baby+Duck · · Score: 1

    How does Lisp tap into a dynamic link library written in an imperative language?

    --

    "Love heals scars love left." -- Henry Rollins

    1. Re:Talking to the OS by Anonymous Coward · · Score: 0

      You just tell it to load the library (using alien:load-foreign on CMUCL; I think just load on Allegro), and then provide a description of what's in it (functions and data structures), and then just use it like any other Lisp form. It's generally much easier to access foreign (meaning non-Lisp) libraries from Lisp than from any other language I know of.

    2. Re:Talking to the OS by be-fan · · Score: 2, Informative

      It depends on the compiler. Nearly all Lisp systems have what's called an FFI, to access native libraries. Interpreters like Clisp have the runtime intercept ffi calls, and call the shared library. Compilers that compile to native code just use whatever ABI is specified by the platform. The system just sees machine code, it has no idea whether that code comes from cmucl or gcc.

      --
      A deep unwavering belief is a sure sign you're missing something...
  133. Prolog in Lisp by sleepingsquirrel · · Score: 1
    Prolog-in-Lisp is an academic exercise designed to impress students. A PROLOG compiler is 99% optimizer. Prolog-in-Lisp embeds an unoptimized constraint solver and then interprets it. There are 4 or 5 orders of magnitude speed difference, which is the difference between a tool and a toy.
    Maybe you'd like KANREN instead?
    KANREN is a declarative logic programming system with first-class relations, embedded in a pure functional subset of Scheme. The system has a set-theoretical semantics, true unions, fair scheduling, first-class relations, lexically-scoped logical variables, depth-first and iterative deepening strategies. The system achieves high performance and expressivity without cuts.
  134. Do you know how to read? by Some+Random+Username · · Score: 1

    Sure programmers forgetting to close open streams is a real world problem. Its also a real world problem that can easily be solved in shitty old C++ just with a simple, ordinary class, nevermind dynamic languages. The only thing that sets your example apart is that you make up a nonsense restriction "add a keyword to the language" which has no effect on solving the actual problem. The problem is solved just fine without adding a keyword, and that's the only thing that makes the lisp solution different. That's not better, that's just different.

    And yes, I don't fully understand lisp macros, that's the whole point. You are supposed to be explaining how lisp is so superior to everything else, for those of us who don't know it. Instead, you are being typical lisp weenie and claiming its better by making up bullshit reasons that don't matter, and saying "you don't understand" whenever anyone points out that your example is retarded.

    Now, quit being a fucking moron and give a real world example of a problem that can be solved significantly easier in lisp than a typical dynamic language like python, ruby or pike.

    1. Re:Do you know how to read? by Anonymous Coward · · Score: 0

      In Lisp you can add features like that yourself. In other languages you have to wait for the language designer(s) to get around to it, and then wait for vendors to ship new compilers or interpreters that support it. That's why not needing new built-in syntax is so important.

    2. Re:Do you know how to read? by Anonymous Coward · · Score: 0

      There's nothing very difficult to understand about Lisp macros. Maybe it takes some experience to see why they're useful (or maybe not), but they're easy to understand.

      A macro is simply an perfectly ordinary function which takes one argument (actually two, but don't worry about that; I'm only mentioning it because otherwise some smart-arse will call me on it). The argument is the entire macro invocation form. E.g., if FOO is a macro, and the form (FOO BAR (BAZ QUUX)) occurs in your code, the function will get called with the list (FOO BAR (BAZ QUUX)) as its argument. The only difference between a macro and an ordinary function is that macros get called at compile time instead of run time. The result of calling the macro function is then compiled just as if it had occurred where the macro form was.

      Because the Lisp source code is exactly the same as the abstract syntax tree, the macro function is just a function that runs, at compile time, on the abstract syntax tree, and returns a new abstract syntax tree in its place. Just like what happens in other languages inside the compiler. Macros are just "plugins" for the compiler.

  135. Are you trying to be obtuse? by Some+Random+Username · · Score: 1

    You don't have to wait for vendors to do jack. YOU DO NOT NEED TO CHANGE THE LANGUAGE. Why is this so hard to grasp? You can simply make a class that handles this for you, and use that class. This is no more or less useful or easy than making a new keyword and using that.

    This is the entire point I am making, that modifying the language's syntax is not needed to solve problems, and does not make things easier or simpler. This is the standard lisp misdirection, trying to claim that what lisp does is helpful because lisp does it. That doesn't prove anything, show me an actual, real problem that can be solved significantly easier in lisp than in a typical dynamic language.

    1. Re:Are you trying to be obtuse? by Anonymous Coward · · Score: 0

      You stupid monkey. No one is stupid enough to fall for your embarrassinly moronic challenege because when they do give you an example of a macro use that you can't do in another language, you won't understand it because it will be so far out of your mental model of programming. Then you will claim that Lisp is over complicated and 'dumb' or hyped up.

      Here's an example maybe even you can understand: You can write a sub-language that generates code at compile time on top of your core engine that is simple enough for your content creators to write in. This means your content/business rules are distinctly separate from your core applications resulting in:
      a.) an order of magnitude increase in organisation effectiveness since the business knowledge people are writing your business side code for you -exactly as they would like it. They can tinker with it as much as they like, as someone would with HTML
      b.) significantly more maintainable code as business code is in the business code language and not mixed with the core application.

      Lisp works here (though I prefer Scheme) because it makes creating these languages much more easily. You can do it in other languages but it is an order of magnitude more easily accomplished (in my experience) in Lisp.

      You can do this in something like C, C++, Java, etc if you use XML in conjunction with the core language, but this has only been available with tools and libraries, whereas with other Lisp and Scheme this has been available since the beginning.

    2. Re:Are you trying to be obtuse? by Anonymous Coward · · Score: 0
      Here's an example maybe even you can understand: You can write a sub-language that generates code at compile time on top of your core engine that is simple enough for your content creators to write in. This means your content/business rules are distinctly separate from your core applications...
      Since when can't you write a domain specific language interpreter/compiler in just about any language in exsistance? And then you can customize your syntax to be exactly what your users expect. Nothing lisp specific here, please move along.
    3. Re:Are you trying to be obtuse? by Anonymous Coward · · Score: 0

      Since when can you write a domain specific language/interpreter in just about a day or two ???

      That's a very specific lisp thing, unless you are as good coding as you are bitching about this.

  136. Re:LISP isn't amazing. by boron+boy · · Score: 1
    Common Lisp macros make debugging much easier because they reduce the amount of code that the original programmer has to write and that maintainers have to read.
    Just because you have less lines of code doesn't mean that it's easier to write, read or understand. The majority of programmers out there don't really "get" recursion (and therefore LISP). I remember what a nightmare it was trying to teach the concept to a bunch of uni students.
  137. Re:LISP isn't amazing. by Anonymous Coward · · Score: 0

    No offense, but it sounds like the teacher doesn't really understand recursion either. Proper recursion can always be rewritten as a loop, while improper recursion typically can/will eventually cause a stack overflow (or out of memory condition on stackless architectures).

    While they're theoretically useful, improper recursions are of limited practical use, since they're only valid when the maximum depth is known in advance to be less than physical limit imposed by the architecture. For example, it's usually safe to do an improper recursion on a list of length 5, but it's rarely safe to use the same recursion on a list of length 5,000,000. (* Please spare me any "know your data" rebuttals.)

  138. Re:Here's your first lesson on macros by sleepingsquirrel · · Score: 1
    ...as a macro call is identical to a function call, which is really why I never found macros that confusing).
    But of course that overlooks the fact that macros aren't first class citizens (unlike functions). You can't in general pass them to higher order functions like map. And here's an unrelated question, does CL have any hygenic macros system similar to Scheme's "syntax-case"?
  139. Re:Here's your first lesson on macros by Anonymous Coward · · Score: 0

    Fortunately, no. Doesn't need it, doesn't want it. Scheme only needs it because they brokenly puts function names and variable names in the same namespace.

  140. Re:LISP isn't amazing. by Anonymous Coward · · Score: 0
    The majority of programmers out there don't really "get" recursion (and therefore LISP).


    You're just showing your ignorance. Lispers don't use recursion any more than C programmers, or any other language that "the majority of programmers" can supposedly understand.

    BTW, it's spelled "Lisp", not "LISP"
  141. Re:Here's your first lesson on macros by Anonymous Coward · · Score: 0

    What are you talking about? Hygiene or first class macros? CL could certainly benefit from hygienic macros. Heck there's quite a bit of discussion in On_Lisp on variable capture. (although I'm aware that Paul Graham isn't a fan).

  142. Re:My first exposure to list ( and a mirror of boo by Gorbag · · Score: 1
    I've heard it said that someone just learning how to program can pick up Lisp in a day. If you happen to already know Fortran, it will take two days.
    Back when I worked at a University, I did some Lisp (and AI) tutoring on the side. It really was far easier tutoring the Liberal Arts set than those who thought they were hackers - less to unlearn.
    --
    -- I speak only for myself
  143. Re:Here's your first lesson on macros by Anonymous Coward · · Score: 0

    Both. "Hygiene" is unnecessary and painful. "First class macros" would be pointless: macros run at compile time, so there's no need for them as first class data at run time.

  144. Re:LISP isn't amazing. by boron+boy · · Score: 1
    From here:
    Recursion is Lisp's natural computational mechanism; the primary programming activity is the creation of (potentially) recursive definitions.

    You were saying?

  145. Re:LISP isn't amazing. by boron+boy · · Score: 1
    sounds like the teacher doesn't really understand recursion either

    How did you arrive at this conclusion? In my previous comment I did little more than use the word recursion. I did not explain what it meant or provide an example. There is simply not enough information in my comment to determine whether or not I understand recursion.

    Proper recursion can always be rewritten as a loop

    Doing so will result in lengthier code. My comment was written in response to the statement that having less lines of code makes things easier to understand and maintain.

  146. Re:LISP isn't amazing. by Anonymous Coward · · Score: 0

    I said Lispers don't use recursion any more than programmers in other languages. Which is true. If you have a source that says otherwise, your source is wrong.

    Schemers use recursion a lot, but Scheme isn't Lisp.
    (I checked your link: sure enough, it's a Scheme text)

  147. 24 special forms? by Anonymous Coward · · Score: 0
    Common Lisp has 24 special forms. 24 is not "a bazillion". Special forms (special operators, in modern parlance) are the primitive syntax of the language -- equivalent to the grammar of other languages. Almost all other languages have more "special operators" than Common Lisp.
    Hmm... Maybe I'm confusing my terminology? I found a reference which claimed that CL only had 24 special forms (table 5-1), but I noticed that things like loop and do were missing from the list! What's the catch? Are we trying to slide under the radar by calling those macros or something? I'm honestly interested in knowing why those aren't considered "special forms" (or "special operators"). Here, I'm thinking that anything that doesn't evaluate its arguments like a function call should be called a special form. And since I'm truly looking for an answer to this, I'll leave out the semi-trollish point I was going to make about CL violating the maxim "Things that are similar should look similar, things that are different should look different."
    1. Re:24 special forms? by Anonymous Coward · · Score: 0

      Yes, those are macros; macros are not special operators. Special operators are primitive syntax; macros are just perfectly ordinary functions written using that syntax. If Lisp didn't have macros, you could add them yourself, entirely in Lisp; and if a particular macro (say, LOOP) were missing, you could add that too. And of course you can write your macros. If a particular special operator was missing, there's not much you could do about that; that would affect the ability to use the language (though with just LAMBDA you have a Turing-complete language; in theory, you could implement a virtual Common Lisp (meaning: no I/O or anything; it'd have to fake filesystem accesses, etc.) on top of the restricted language, even if _all_ of the special operators, standard functions and standard macros were missing - but that's no different than implementing it in C or Java, which also don't have the same special operators as CL; it's a new implementation, not an extension of the existing one)

  148. First class macros... by Anonymous Coward · · Score: 0

    Maybe you'd like to do some reading up on first class macros. Heck, even Arc apparently has first class macros.

  149. Addendum by Anonymous Coward · · Score: 0

    Ok, technicalities aside (although in the Scheme world I think you'd say macros introduce new special forms), I'll modify my claim to, "you have to learn a bazillion 'special forms' and/or macros if you want to use CL effectively (and that makes it ugly)."

    1. Re:Addendum by Anonymous Coward · · Score: 0

      If "bazillion" means "a few dozen" -- the same way you have to learn the few dozen grammatical constructs in other languages. Is it harder to learn "(defclass (...) (...))", since that's a macro, than it is to learn "class (...): ..." in Python, or "class <name> : public <bases>... {...}" in C++, where those are built in to the grammar? I think not.

      Why not "you have to learn a bazillion grammar rules if you want to use C++ effectively (and that makes it ugly"; "you have to learn a bazillion grammar rules if you want to use Python effectively (and that makes it ugly)", ...

      Macros don't make it uglier, or more difficult (quite the opposite: they oten make it significantly prettier and easier than in other languages (that's their purpose!), but at the very worst they just make it equally ugly and difficult as in any other language)

      [BTW, of the 24 special operators, you can probably get by quite comfortably with just 5 or 6: IF, LET, PROGN, QUOTE and SETQ; maybe add UNWIND-PROTECT]

    2. Re:Addendum by Anonymous Coward · · Score: 0
      Why not "you have to learn a bazillion grammar rules if you want to use C++ effectively (and that makes it ugly)"
      Who's arguing with that? You'll note C++ is on the ugly side of "ugly step-child" table above.
  150. Re:LISP isn't amazing. by boron+boy · · Score: 1
    I beg to differ. I can't find any concrete statistics, but my reasoning is as follows.

    Lisp is mainly used for AI and other tasks that involve processing large, nested lists. Such tasks naturally lend themselves to recursion. Other proceedural and object oriented languages (C++, Java etc) are used for a much wider range of tasks (GUIs, TCP/IP communications, automation etc). Such tasks generally do not benefit from recursion as much as list processing does. Therefore it is safe to assume that recursion is used more often in Lisp than in these languages.

    Incidentally, Lisp, in its original incarnation, did not even have iterative operators. Recursion was the only way to perform a loop.

  151. Re:LISP isn't amazing. by Anonymous Coward · · Score: 0
    Lisp is mainly used for AI and other tasks that involve processing large, nested lists.


    I doubt that.
  152. Perl anyone? by Anonymous Coward · · Score: 0

    Why do I have the sinking feeling that the next thing you're going to tell us is that you admire Perl's compact set of built-in functions and clean grammar?

  153. Haskell & DSLs [was: Are you trying to be obtu by sleepingsquirrel · · Score: 1
    Since when can you write a domain specific language/interpreter in just about a day or two???
    Heck, the Haskell people love to do just that type of thing. Here's an online bibliography on Embedding Domain-Specific Languages in Haskell to get you started. In fact, in the intro to Haskell book, The Haskell School of Expression: you construct a number of DSLs.
    This book teaches functional programming as a way of thinking and problem solving, using Haskell, the most popular purely functional language. Rather than using the conventional mathematical examples commonly found in other programming language textbooks, the author draws examples from multimedia applications, including graphics, animation, and computer music, thus rewarding the reader with working programs for inherently more interesting applications. Aimed at both beginning and advanced programmers, this tutorial begins with a gentle introduction to functional programming and moves rapidly on to more advanced topics. An underlying theme is the design and implementation of domain specific languages, using three examples: FAL (a Functional Animation Language), IRL (an Imperative Robot Language), and MDL (a Music Description Language)...
    And it seems like there's quite a few people doing DSLs in languages other than lisp.