News for hackers. Stuff that matters.
Re:C++ vs. Lisp by gruseom on Tuesday May 04, 2010 @12:56PM (#1318593)
I'm really tired of hearing this:

syntactic abstractions dont scale up with the number of programmers

... as an objection to Lisp macros. It has become the invariable staple of these discussions and is accepted (by the people who accept it) without any question. Yet is there any evidence for it? I don't think I've ever even seen any evidence alleged for it.

The fact is, to justify this statement requires more than proving it's true. You'd have to prove that this failure of syntactic abstraction to "scale up with the number of programmers" is worse than the failure of abstraction in general to do so. Indeed, in my experience, it's programming that fails to scale up with the number of programmers.

Re:C++ vs. Lisp by dman on Tuesday May 04, 2010 @01:54PM (#1318789)
I dont know what you count as evidence but here are two eminent authorities speaking about related topics - Turing award winner Barbara Liskov - http://www.infoq.com/presentations/liskov-power-of-abstracti... (Syntactic abstraction related talk starts at minute 17).

Heres what Dijkstra has to say about something that is tangentially related (he is talking about the importance of read time comprehensibility of code). "My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed. For that reason we should do (as wise programmers aware of our limitations) our utmost to shorten the conceptual gap between the static program and the dynamic process, to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible." This is from the influential GOTO considered harmful paper.

Re:C++ vs. Lisp by JBiserkov on Tuesday May 04, 2010 @02:25PM (#1318884)
"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."

- Edsger Dijkstra, CACM, 15:10

Re:C++ vs. Lisp by gruseom on Tuesday May 04, 2010 @06:46PM (#1319683)
Not to take anything away from Dijkstra and Liskov, but of course I don't count their opinions as evidence; eminent authority opinion is what one resorts to in the absence of evidence.

I don't have time to watch the video, but it seems rather obvious that the Dijkstra quote has little to do with macros. What he's saying sounds to me like "lexical scoping is easier to understand than dynamic scoping". If anything, that makes macros more valuable rather than less, since macros are intrinsically lexical and macroexpansions don't typically change over time.

Re:C++ vs. Lisp by silentbicycle on Tuesday May 04, 2010 @02:33PM (#1318905)
Dijkstra's quote sounds more like an argument for defaulting to immutability than anything about syntactic abstractions. (I happen to agree with him, there.)
Re:C++ vs. Lisp by dman on Tuesday May 04, 2010 @03:22PM (#1319009)
"to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible". Most programmers read programs as plain source most of the time, ie not as macroexpanded source. If editors showed macroexpanded source code by default, things would be different. Also macroexpansion does in practice affect the ability of the compiler to highlight what line caused the error, or the ability to step through code intuitively (you are stepping through macroexpanded code and sometimes its tiresome to be able to intuitively understand how that relates to code that you wrote).
Re:C++ vs. Lisp by MichaelSalib on Tuesday May 04, 2010 @02:20PM (#1318873)
Let's assume for a moment that the critique is correct: macros don't scale. OK. The C++ templating system can be used to accomplish many of the same things as a good macro system (see http://matt.might.net/articles/lambda-style-anonymous-functi... for one example). Does the C++ templating system "scale"?

Or, to put it another way: lots of C++ shops ban the use of advanced templating metaprogramming. Has C++ suffered egregiously as a result?

Re:C++ vs. Lisp by gruseom on Tuesday May 04, 2010 @06:55PM (#1319705)
How does assuming that macros don't scale help in proving that macros don't scale?

How does the complexity of C++ templates prove anything about syntactic abstraction in general or Lisp macros in particular?

Re:C++ vs. Lisp by MichaelSalib on Tuesday May 04, 2010 @07:05PM (#1319732)
C++ templates are both less powerful and more complex and fragile than lisp macros. But no one ever says "oh, the C++ templating system does not scale" or "oh, C++ will never be successful until it eliminates/replaces the templating system"...do they?
Re:C++ vs. Lisp by gruseom on Wednesday May 05, 2010 @12:10AM (#1320309)
I think I misunderstood your original point. Thanks for the clarification.