Lambda the Ultimate

inactiveTopic (Lisp) Beating the Averages
started 5/1/2001; 11:32:56 AM - last post 5/4/2001; 5:50:21 AM
andrew cooke - (Lisp) Beating the Averages  blueArrow
5/1/2001; 11:32:56 AM (reads: 1772, responses: 5)
(Lisp) Beating the Averages
Paul Graham (author of the excellent On Lisp) has written an article on Viaweb (Yahoo! Store).

[...] and if Lisp is so great, why doesn't everyone use it?

From /.
Posted to general by andrew cooke on 5/1/01; 11:36:10 AM

Ehud Lamm - Re: (Lisp) Beating the Averages  blueArrow
5/2/2001; 9:17:37 AM (reads: 1834, responses: 1)
Fun!

(another go at linguistic relativity)

andrew cooke - Re: (Lisp) Beating the Averages  blueArrow
5/2/2001; 1:59:59 PM (reads: 1920, responses: 0)
I've asked this on the haskell-cafe list and I may as well duplicate it here as I suspect there aren't many people who read both:

Graham puts a very strong emphasis on macros. How much of that flexibility can be done by higher order functions (which I, at least, find easier to control in a statically typed language)?

Also, how useful are the packages (I'm sure there is something ML, at least) for manipulating code in statically typed languages?

If his advice is worth following then macros seem to imply that Lisp is "more powerful" than Haskell/OCaml/SML - I'm wondering how true that is.

Ehud Lamm - Re: (Lisp) Beating the Averages  blueArrow
5/4/2001; 4:18:59 AM (reads: 1810, responses: 0)
I am no expert on lisp macros, but in general I think macros serve two main purposes. For one thing they allow syntax extension, which is (arguably) useful for stratified design. This is made possible by the other important trait of macros: they allow lazy evaluation. This, of course, is only important in languages that are eager.

The syntax extension problem is quite thorny. Many love the concept, others hate it. My views swing between these extremes. On the one hand syntax extension is cool, and can help you in creating little languages, usually domain specific. On the other hand, from a software engineering perspective, I think this can be problematic, since it can make code harder to read and maintain.

Ada chose not to include macros. PL/I macros were very powerful, but also (I think) one of the atrocious features of the language. Scheme has hygenic macros, which may be seen as a compromise.

It seems to me that most modern languages shy away from macros. Perhaps laziness is a solution. But it also looks like people are using other language features (like C++ templates and functor objects) to try and mimic macros. In such cases it would seem that macros are a much more elegant alternative.

Ehud Lamm - Re: (Lisp) Beating the Averages  blueArrow
5/4/2001; 5:21:14 AM (reads: 1812, responses: 1)
Also check the paper Syntactic Abstraction in Scheme.

andrew cooke - Re: (Lisp) Beating the Averages  blueArrow
5/4/2001; 5:50:21 AM (reads: 1912, responses: 0)
In Lisp's defense, I think it's fair to say that capture is very well recognised and described in any introducty text on macros (that's not to say it can't happen, but the Lisp community has devised patterns for making it manageable).

OTOH, hygienic macros seem like a big improvement! ;-)