There's too many implementation decisions for this to be feasible. E.g., you'd have to standardize exception handling implementations and object layouts.
In practice, GCC has tried to standardize a C++ ABI for some platforms, but each proposed "standard ABI" has been buggy and required at least moderately backward-incompatible ABI changes between GCC releases.
> Massive bloat. Take a look to the Boost libraries and cry.
Define "bloat"? Large parts of Boost are absolutely horrid (e.g. Spirit), but I don't know what you mean by "bloat". Do you mean that the resulting object code is big?
> Poor debugging tools for templates (debugging templates it is crazy, and the promise of easy template debugging is almost a decade old).
Agreed. Hopefully clang is fixing that. http://clang.llvm.org
> Obsession for doing everything in "user-land" (e.g. source code templates) instead of built-in abstractions at object code-generation time instead of compile-time.
Huh? What do you mean by "built-in abstractions at object code-generation time"?
> C++ hour will come, with a non-bloated, system-software capable, "better than C", which could be labeled "simple C++", as in "simple English".
I was hoping that Digital Mars D would be the "Simple C++", but it feels like D is losing momentum.
(Sidenote: I've been programming in C++ for about 13 years, and am a recovering C++ "language lawyer".)
I was hoping for the same for a long time. Now my favourite "simple C++" is OOC (http://ooc-lang.org/). The syntax is a bit different (partially justified by faster parsing/compilation and has a lot of nice sugar), but it does support a lot of the good stuff: classes, generics, ability to use C-layout structures and attach "methods" to them, closures, pointers to allow easy C libs interaction and more...
Aside from your tears, what is the evidence that boost is bloated? Too slow? Too much source code? Too many files?
I've been using Boost for nearly a decade. It does a ton of useful stuff (from template metaprogramming to fast matrix algebra), it's loosely coupled, and it's insanely fast. Given it's scope, it's the least bloated library of which I know.
C++ has been evolving, but for the last decade, all of the evolutionary changes have come in the world of templates and template metaprogramming. I think this is hard on the people who have restricted themselves to the C-with-classes mentality. They're missing every modern development in the language since ~1998.
It's actually not all that fast in a lot of cases. Boost's matrix manipulation support is particularly slow:
http://eigen.tuxfamily.org/index.php?title=Benchmark-August2...
Also a lot of the template aerobatics generate a ginormous number of symbols which massively increase the binary size and cache pressure. In a former life I ripped out a pile of heavily templated code using Boost and replaced it with a well placed virtual function or three and dramatically reduced the cache misses in the application.
I've always seen Boost (and to a large extent the STL) as a demo library to show off what's possible with templates rather than something to be used in everyday code and have worked on a number of projects which forbade both.
There's a large rift in the C++ world between what I generally label Qt and Boost camps. The Boost people see the Qt folks as Java-esque dimwits that can't be bothered to learn the full extent of C++'s power and the Qt folks see the Boost following as unpragmatic architecture astronauts.
You've picked a benchmark of the most highly optimized matrix algebra libraries, and found that uBLAS is mid-pack, even though a) it isn't particularly optimized for any platform, and b) its goal is to result in the clearest possible syntax without sacrificing adequate performance. Talk about picking nits.
"Also a lot of the template aerobatics generate a ginormous number of symbols which massively increase the binary size and cache pressure."
When it really matters (which it rarely ever does): man strip
"I've always seen Boost (and to a large extent the STL) as a demo library to show off what's possible with templates rather than something to be used in everyday code"
I worked on shipping commercial products that used boost and the STL, and I did nearly all of my speed-sensitive code with it in grad school. It's far more than a demo library. Like I said before, you don't have to use all of it to use some of it.
Second of all, those symbols will have an effect on compile times, but they should certainly be stripped out by the linker. Why would symbols that do nothing sit in the executable?
Thirdly, Boost's purpose is to iterate faster than the C++ standard library and have real-world data about what libraries work and are needed. Those libraries would then be included in next C++ standards, as it has happened with TR1. There are useful libraries inside Boost and there are research libraries or concept libraries. Don't use a library just because it's included in Boost!
I use Boost and Qt. Since TR1 I didn't need Boost as much, which means that it's achieved one of its goals.
With gcc 4.4.5 and -O2, this one small file takes 22 seconds (!) to compile and produces a 14MB output file.
I guess that's... tolerable. But it isn't "lean" in any meaningful sense.
Your point seems to just be agreement with mine: C++ bloat is tolerable. It's still bloat.
Seriously, I think it's too much trick to do meta-programming in the language. If meta-programming should be allowed, it should be easier, simpler, and for the ordinary people. Just like Ruby.
But why does the metaprogramming syntax in C have to be so convoluted, bloated and difficult? Do we really need >30 second compile times per file on recent CPUs? If a language is hard to parse both for computers and humans, something went wrong. It should be easy to read for one of both, preferably both.
Also, as far as I know, most compilers were settling on a fairly standardized IA64 ABI, even for other platforms. The problem gcc had, last I checked, was after every release, they found a bug in the implementation and fixing it made the next release incompatible, but the goal was to be interoperable.
Indeed!
The thing I don't understand is that you go to the boost library website and you see that it touts itself as an all-volunteer effort.
Who are these people who volunteer their time to produce this massively bloated, over-elaborated code? What is their motivation? What's going on here? I understand bureaucracies usually bureaucrats are paid and produce code and memos to expand and control their turf. But here? What's up?
Boost certainly seems well done for what it is. But does this particular niche attract so many people?
There are many different components in there.
If you can give me an example of a part of this "continent" which is "lean and mean" rather than over-elaborated, I'd be grateful.
This I think is the power of C++ - it is a multi-paradigm language, and you are perfectly free to not use some of the paradigms, or more powerful techniques.
I would like to see something better come along that has some of the low-level power of C, but also supports sophisticated high-level abstractions. I was hoping Go might fit that bill, but the Go designers have made some interesting choices that seem to alienate a lot of developers.
Objective C this very well. It adds classes and protocols. Closures can be implemented with blocks. Everything else is the same as in C.
However, much of joy of using Objective-C is Apple's Cocoa Foundation classes. Stuff like autorelease and NSString are not part of Objective-C's core language. And support for Objective-C or Cocoa on non-Apple platforms is limited or not well-supported.
As you've said: everything else is the same as in C.
Unsolved things:
- Unified C++ ABI call for making shared libraries without worrying about compiler manufacturer or version.
- Massive bloat. Take a look to the Boost libraries and cry.
- Poor debugging tools for templates (debugging templates it is crazy, and the promise of easy template debugging is almost a decade old).
Ridiculous things (in my opinion):
- Obsession for doing everything in "user-land" (e.g. source code templates) instead of built-in abstractions at object code-generation time instead of compile-time.
- Willing to introduce functional programing in the language, when, in my opinion, it makes more sense just to interface with true functional code (e.g. via SBCL).
C++ hour will come, with a non-bloated, system-software capable, "better than C", which could be labeled "simple C++", as in "simple English".