Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

His arguments are based on the premise a programmer can see when a language is less powerful than that he is using because the lack of an essential key feature, and that Lisp's macros is a key feature for which no other language has something equivalent.

As of 2012, is this still valid?

share|improve this question

closed as not constructive by Jesse C. Slicer, gnat, Oleksi, Caleb, AProgrammer Jul 3 '12 at 6:34

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

It would be useful to link to the statement you're asking about. Are you asking about What Made Lisp Different? –  Greg Hewgill Jul 3 '12 at 4:14
This was a statement of opinion in the first place, so the only kind of "still accurate" it could be would be if it's still Paul Graham's opinion. So... go ask HIM. –  mjfgates Jul 3 '12 at 4:14
Matter of opinion but Lisps have a tremendous flexible and expressive system. Almost dangerously so...so I believe him. –  Rig Jul 3 '12 at 5:00
You can improve your question if you change the formulation. While one can argue whether Lisp macros are a key feature that makes Lisp more powerful than other languages, one could ask if there are any recent languages that offer a similar concept. In the latter case you are asking about a fact, not an opinion. –  Giorgio Jul 3 '12 at 5:25
add comment

2 Answers

up vote 12 down vote accepted

"Lisp macros are a key feature that no other language has" is a vague and subjective statement, but there's definitely a real point behind it. If you really want to know how macros are such a key feature, you should read "On the Expressive Power of Programming Languages", which is a paper that Matthias Felleisen wrote, where he defines the concept of "expressive power" more formally.

As for Graham's assertion that no other language has something equivalent, there are two sides for that. On one hand, as time goes by it is less and less true. There are several modern languages that have started to play with reflective capabilities, and specifically with macros. As a sidenote, macros are very different from some eval function even though it looks like you can do similar things with them. Also, some of these reflective facilities come in the form of parsers -- but if you read the above paper you'll see that one of the major aspects of macros is that they are local transformation rules, which means that you can extend a language rather than define a new language by translation.

The second point is that "Lisp macros" is itself a concept that is not too well defined. For example, many Lisps have symbolic macros, while Scheme macros look very different (and I won't go into opinions about the differences). In addition, Lisps traditionally have "reader macros" which are somewhat like macros in that they can extend the existing language, but they operate at the level of reading the source code, which means that you can extend the actual syntax of the language. Again, an important point here is extending the existing syntax rather than writing a whole new parser (which is possible as with all languages, but requires much more effort).

Finally, this is still an area where development is going on. An obvious example would be Racket (a dialect of Lisp/Scheme), which has a very powerful macro system & a reader macro facility, but it goes beyond traditional lisps by making it work with a module system, well defined stages for starting from text and getting to executable code, investigating the concept of macros as a kind of "compiler plugins" and much more. The result is a language which makes it very easy to define and use new dialects, essentially making it a greenhouse for growing languages.

share|improve this answer
Insightful. Thanks. –  Dokkat Sep 27 '12 at 22:40
add comment

Definitely not. Both Boo and D are also capable of arbitrary compile-time code execution- not to mention that existing languages as of that time, like Java and C#, could dynamically invoke user-generated code and reflect on existing code through their reflection APIs.

share|improve this answer
"Arbitrary compile-time code execution" = either eval or just call the compiler; "dynamically invoke user-generated code" = dlopen or similar; both of these are very different from macros. ("Reflection API" goes somewhat closer as a highlevel concept, but in these cases the reflection is more about introspecting the class/object system than looking at source code...) –  Eli Barzilay Jul 3 '12 at 6:14
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.