How I stopped worrying and switched to C++ for my Bob Scheme VM
eli.thegreenplace.net
eli.thegreenplace.net
But so many articles are like "C++ isn't OO", "C++ has awful syntax", "C/C++ is insecure", "ZOMG templates", etc.
Any language that lacks a diversity of opinions about its strengths and weaknesses doesn't sound very interesting to me. I suspect it lacks expressive power.
I once started a job which involved a little bit of Perl. The other Perl programmers on the team were a little freaked out by my unfamiliar Perl syntax. I didn't tell them that everything they objected to was from the O'Reilly book "Perl Best Practices". :-)
- For 'whole-project' compiles, limit the amount of them to the absolute minimum. Use unit tests to test fundamental functionality rather than running the whole program.
- Use a compiler that supports precompiled headers, understand how it works and use it as it's designed.
- Pay attention to your #include graph. Only include headers where they're used (i.e., in the .cpp file and not in the header where it's possible), use Cheshire cat where possible, and put as much into the precompiled header as possible.
Doing all of these things make C++ compilation bearable, but still it's a nice change when I write code in C# or 'scripting' languages and compilation times disappears. It's one of the more annoying aspects of C++, but despite it and a bunch of other nitpicks, it's still my favorite language.
https://github.com/marshray/qak/tree/
For example, my simple implementation of min and max<T>(a, b) amount to just a few lines of code. But using them instead of std::min/max means you don't have to #include <algorithm> ... a savings of 39274 LoC!
clang++ is even faster.
Visual Studio 2010 has a decent compilation speed if you use a Dos prompt.
I've been pondering writing a GC in Vala to learn more about them, and see how suitable Vala is to low-level work.
The code is wholly in the public domain, by the way - http://code.google.com/p/bobscheme/source/browse/COPYING