5 ms·
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 in
by gruseom 17y ago
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.
- deleted 17y ago[deleted]
- dman 17y agoI 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-abstraction 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.
- JBiserkov 17y ago"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
- silentbicycle 17y agoDijkstra's quote sounds more like an argument for defaulting to immutability than anything about syntactic abstractions. (I happen to agree with him, there.)
- dman 17y ago"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).
- gruseom 17y agoNot 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.
- MichaelSalib 17y agoLet'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-functions-from-c++-templates/ 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?
- gruseom 17y agoHow 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?
- MichaelSalib 17y agoC++ 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?
- gruseom 17y agoI think I misunderstood your original point. Thanks for the clarification.