News for hackers. Stuff that matters.
Re:Why Lisp? by aidenn0 on Thursday May 07, 2015 @06:46PM (#9508894)
The majority of macros I write could be represented with HOF and lexically-closed lambdas. That adds significant extra syntax when you use them though.

Consider a classic pattern of a with macro:

    (with-mutex-held-macro (some-mutex) (do-stuff))

    (call-with-mutex-held-hof some-mutex (lambda () (do-stuff))
A minor advantage is that a macro will be expanded in-line; a Sufficiently Smart Compiler could transform the HOF version into something equivalent, so it's not strictly an advantage (except to compiler implementers I suppose).

I think that e.g. generalized references (i.e. the common lisp setf macro) are not possible with HOF, but HOF is more common in pure languages where assignment is eschewed anyway.

Mark Jason Dominus (author of Higher Order Perl) had some good comments on lisp macros as well:

http://lists.warhead.org.uk/pipermail/iwe/2005-July/000130.h...

Re:Why Lisp? by dllthomas on Thursday May 07, 2015 @07:31PM (#9509104)
One thing to note is that you're using the macro or lambda to delay evaluation. In a lazy-by-default language, that's unnecessary (which is a part of why macros are less useful in Haskell).
Re:Why Lisp? by wtetzner on Friday May 08, 2015 @04:28AM (#9510545)
There's a class of things that don't require macros in Haskell, but I don't think that means macros are less useful in Haskell. There are plenty of things you might want them for, like generating new definitions.
Re:Why Lisp? by dllthomas on Friday May 08, 2015 @10:35AM (#9511909)
I certainly didn't want to imply that macros were not useful in Haskell. Just that there's good reasons you see them less often.

Depriving a Haskell programmer of the ability to define new macros is going to hurt a whole lot less than depriving a Lisp programmer of the same.

Re:Why Lisp? by eru on Friday May 08, 2015 @03:42AM (#9510430)
True. They are still useful enough for Template Haskell to exist.
Re:Why Lisp? by dllthomas on Friday May 08, 2015 @10:35AM (#9511910)
For sure.