3 ms·
I don't understand your point. C++ does not have the ability to manipulate syntax trees as data the way Lisp does, for example, making it strictly less "powerfu
by gcr 13y ago
I don't understand your point. C++ does not have the ability to manipulate syntax trees as data the way Lisp does, for example, making it strictly less "powerful" in terms of abstraction. (Templates, though turing complete, aren't what I mean here)
- SamReidHughes 13y agoLisp isn't a mainstream language. Edit: Also, I don't know much about Lisp, despite being a bit of a Scheme weenie in the past. When I try to think about whether I'd like to implement some hypothetical project in Lisp or C++, the most important difference between them seems to be garbage collection. It's more realistic to ask whether I'd rather use Lisp vs. Java, or Lisp vs. Scala, or Lisp vs. C# or Python or Ruby, than C++, because garbage collection is a big issue that makes it difficult to compare them by some notion of how it would feel to use the languages. I have a hard time evaluating whether macros are really that useful. Whenever I see people give examples of using macros, usually it's just superfluous, something that could be done a bit more verbosely without macros in a language like Python or Ruby, or done a bit superiorly in something like Haskell. And if it were a situation where macros were very useful, all I can think then is (now let's pull some anti-macro tropes out of the hat!) how debuggable is this? And would it really be that hard to solve the same problem in one of the other languages?
- mihai_ionic 13y agoHave you looked at Boost.Proto? You can in principle manipulate syntax trees in any way you like, but you'll have to spice things up a little to fit with operator overloading.