Monday, December 22, 2008

Lisp

One more reason to love lisp: it's a language where every function call is actually a funcall.

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Fun or not, the language is unusable. Really which is better:

    (winopen window (add xBase (times xMultiplier gridSize) (add yBase (times yMultiplier gridSize)) screen)

    or...

    Window
    openX: xBase + (xMultiplier * gridSize)
    Y: yBase + (yMultiplier * gridSize)
    viewport: screen.


    Really, syntax in the real world does matter.

    Oh, and of course functional programing is cool, but in the real world (beyond a few neat algorithms, you need objects.

    Here's a question: would you rather implement objects in terms of a functional paradigm (works, but not really well) or functional programing in terms of a real object based system (trivial).

    I understand your frustration with Java, but LISP is not the answer. Sadly, Smalltalk (or a Smalltalk like system, since the language was clearly intended only for experimentation) WAS the answer.

    C set us back 20 years. Now Java is setting us back another 20 years.

    Do yourself a favor and look at smalltalk.

    ReplyDelete
  3. Rejoice, Greg, for your complaints about LISP have been answered! In Common Lisp these days the example you gave could look like this:

    (open-window :X (+ xBase (* xMultiplier gridSize))
    :Y (+ yBase (* yMultiplier gridSize))
    :viewport screen)

    You're not exactly honest because you're comparing a somewhat-formatted Smalltalk function call with a function call in LISP containing only semantically meaningful whitespace. From the little experience with LISP I have, the code formatting maintained by every half-witted text editor for LISP files is more than sufficient to maintain clarity.
    In the end, it all boils down to whether or not you like braces and RPN (which, frankly, makes a lot of sense, especially for more complicated expressions).

    Moreover, Common Lisp has a solid and easy to use OO system called CLOS, which is really an ANSI-specified fundamental part of the language.
    The common consensus is that CL is a multiparadigm and not a functional language.

    I know that your past experiments with LISP (n years ago) might have left a bad taste.. but really, do yourself a favor and check out Common Lisp :) (A great free book called "Practical Common Lisp" can be found here (http://www.gigamonkeys.com/book).

    ReplyDelete
  4. No, I think I am being fair :-)

    Lisp (or rather Scheme since common lisps scope rules are just plain bizarre) never did leave a bad taste in my mouth, actually I quite liked it.

    It's just not practical (and to be fair was never really meant to be).

    Also, the fact there is a bolt-on object library for lisp, just shows the problems with lisp. Objects should not be an add-on at this point.

    You're right that I wasn't aware of the new syntax with spreading the function names across the parameter list. That's a big step forward, but...

    So now the question remains: what do we need those brackets for exactly? Brackets should be used as their used in math: to set the order of evaluation.

    I've done enough lisp to know that the alternatives are better. Thanks for the book recommendation, but you should really read a book on smalltalk and then we'll talk :-)

    ReplyDelete