Posted Dec 13, 2011 18:39 UTC (Tue) by dgm (subscriber, #49227)
In reply to: LLVM 3.0 released by daglwn
Parent article: LLVM 3.0 released
> Of course C++ is more complex than C. It's more powerful.
Both are Turing-complete, and thus are equivalent in power (as in what you can write with them). Maybe you wanted to use the term "expressive", but that's not very well defined (http://en.wikipedia.org/wiki/Comparison_of_programming_la...). In fact, according to that article, Python, Smalltalk and Perl are more expressive than C++ (and much more than C).
Posted Dec 13, 2011 20:17 UTC (Tue) by nybble41 (subscriber, #55106)
[Link]
Both C and C++ are Turing-complete[1], but AFAIK only C++ has a built-in Turing-complete metaprogramming interface at compile time in the form of templates. That can reasonably be considered an extra measure of power. (Retaining one's sanity while attempting any complex computation with C++ templates is left as an exercise for the reader.)
Posted Dec 13, 2011 21:49 UTC (Tue) by nybble41 (subscriber, #55106)
[Link]
Sorry, I didn't mean "only C++" in that sense. I was only considering C and C++. Other languages do have decent metaprogramming facilities as well, some (IMHO) much better than C++ templates. Lisp macros, for example, or Scheme's syntax expanders. D's more flexible template system ranks highly as well, though the syntax isn't quite as consistent and it relies on parsing generated strings, rather than constructing syntax objects directly.
LLVM 3.0 released
Posted Dec 14, 2011 1:14 UTC (Wed) by dgm (subscriber, #49227)
[Link]
Very interesting reading. I came to the conclusion that C++ templates could be considered a meta-Turing tarpit.