I precise that I restrict this question to “native” development for my x86 (64bits) linux box. No embedded or non-x86 architecture.
Since I’m a C++ user and there is a C++ renaissance, I’m currently using C++ for personnal projects.
Right now I’m using the robust, traditionnal linux/gcc/make toolchain.
But through blog posts and SO questions, I recently became aware of new promising tools :
- ”clang” as an alternative for ”gcc”, a lot faster, giving better error messages
- ”gold” as a replacement of ”ld”, a lot faster
Those tools are less known and it’s easy to not even know about them.
Are there other interesting less known tools that I should be aware of ? For example alternative to gdb or the like ? (I’m also using cmake)
I’m looking for ease of development first, then development speed improvement. Any other improvement is welcome.
Free tools if possible.
You could be interested by ccache (a compiler cache able to avoid useless recompilation, and transparently usable thru the same
g++command, just by adding a symlink inside your$PATH)For C (but not C++) programming, you might be interested by
tinycc– which compiles very quickly (but produce slowly running binary code).When coding, the Boehm’s garbage collector might be used. See this question related to using it in C++.
And also use
valgrindto debug your memory leaks.Sometimes, dynamically loading a shared object with dlopen is intersting. The
dlsym-ed symbols should beextern "C"in C++. I sometimes love generating C or C++ code on the fly, compiling it, anddlopen-ing the module.For building, consider investigating other builders, like e.g. omake.
When compiling, don’t forget the
-Wall(and perhaps-Wextra) flag to the compiler. The new link time optimization (withCXX=g++ -fltoin yourMakefile) could be interesting (but compile time suffers, for perhaps a 10% increase in speed of the executable).If your source code files share all the same C++ header, pre-compiling that header is worthwhile.
Newer (e.g. better than C++) languages exist, like Ocaml and Haskell but also Go and D.
Use a version control system like GIT even for pet projects.
Qt is a good C++ framework, notably for its graphical toolkit.
Wt enables you to code in C++ quite quickly web interfaces.
Both GCC & GDB are still evolving. Don’t forget to use the latest versions (eg 4.6 for GCC, 7.3 for GDB) which provide major improvements over earlier ones.
Consider extending or customizing your GCC compiler for your particular needs thru plugins or better yet using MELT extensions.