by codex · 13y ago · 0 comments
C++'s true merit lies in its flexibility to evolve with the latest understanding of how to write good, abstract code with little runtime penalty, IMHO.
A really good example is libfirm versus llvm. The former is in C< the latter is in C++. They're both roughly the same order of magnitude in size (at least the core). They're both highly optimizing compilers. I find the former far more clear and readable.
I personally find C++'s abstractions to be of questionable value. YMMV.
Fun fact: A full build of libfirm is faster than LLVM's configure.
The compilation process is one of C++ greatest weaknesses. Since the iteration speed (change-compile-runtest) is a significant productivity factor, C can be more productive than C++. On the other hand, D shows that a language with a comparable feature set to C++ can be compiled much faster.
Llvm implements generic compilation with implementations for C, C++, Objective C, Objective C++, Ada, D, Fortran, Haskell, Java bytecode, CIL, MacRuby, Standard ML.
Of course there is a difference in complexity.
Libfirm (with liboo extension) does not support exceptions, but apart from that there should be little difference in features.
For example, there is an experimental frontend for Java bytecode [1]. It compiles ahead-of-time, like gcj.
[0] http://pp.info.uni-karlsruhe.de/uploads/publikationen/liebe1...