
Chris Lattner wrote:
David's characterization is somewhat correct, but is also a bit simplistic. The LLVM project does certainly use templates (including partial specialization etc), but we prefer to keep this as an implementation detail in a library. Exposing "complex" template code through the public interface of a library generally make the library "scary" to those developers who don't consider themselves to be C++ gurus. This design point also reduces build time for the LLVM code itself.
From a rough sketch, I personally feel more scared by the pointers exposed everywhere -- which are one of the greatest sources of unsafety in C++ --, the non usage of RAII, the explicit casts and other unsafe things, the usage of downcasting everywhere etc. I had read that LLVM was supposed to be "finely crafted C++" but it looks more like the usual object-oriented C++ from the nineties that you see everywhere and that contributed to make C++'s reputation of a dangerous and unmaintainnable language. I honestly don't understand how can people be "scared" to use templates, especially compiler writers, which should be able to understand how they work and what they do. They don't add bloat unless you make them do so (especially with LLVM which should be able to remove all unused code and duplicates without any problem). On the contrary, they allow the design of thin layers for robust type safety as well as nice reusable wrappers.