On Feb 7, 2008 6:15 PM, Brandon Van Every <
bvanevery@gmail.com> wrote:
On Feb 7, 2008 11:28 AM, Fabien <
fleutot+lua@gmail.com> wrote:
>
> Then, there are macros. Macros are extremely powerful; as we've seen, they
> can make everything look OK, so it's hard for the language to convey
> opinion, and for a consensus on what's idiomatic to emerge. Another problem
> is, since by using them you essentially design your own single-use language
> for your application, you're the only one in the world using that language
> variant.
But every API and every piece of software out there is similarly
unique. In order to use someone else's code, I have to figure out
what the heck is going on with it. How much pain does that require?
It depends on the design, the documentation, and the degree to which a
community has already been built. Macros aren't a dealbreaker here.
They aren't any worse than a baroque OO hierarchy or an ill-conceived
pile of function calls.
Again, the problem is not formal but human (which doesn't make it any less serious). When you feel free to use macros, you're much more likely to write hard-to-reuse code. It is possible in theory, but much less likely in practice. A very good macro-enabled library will be more modular than a very poorly designed macro-free one, but on average, macros have a significant negative effect on reusability.
It doesn't mean that they're an intrinsically bad feature, simply they aren't one to be used lightly; and my opinion is, the culture that goes with Lisps (and I think this culture is *created* by the languages' design, not a random bad luck) underestimates their cost, and therefore Lispers overuse them.
Rather than trying to see the history of Lisp as a product of its
syntax, you might just say, "AI Winter killed it."
Macros are not simply syntax. And the fact that Lisps can't (or won't) encourage any particular coding style is also more than simply a syntactical matter.
Lisps are the ultimate tools to write applications:
- in tiny teams of very proficient developers
- when you don't really want to reuse existing libraries, and don't expect your code to be reused.
That's a perfectly legitimate niche, but a pretty narrow one.