7 ms·
C++ is a toolkit for constructing problem-specific languages. You do this by creating new types (classes), using templates, template metaprogramming, preprocess
by DenisM 17y ago
C++ is a toolkit for constructing problem-specific languages. You do this by creating new types (classes), using templates, template metaprogramming, preprocessor, multiple inheritance, and all kinds of other stuff.
Once you develop a language, teach it to all your developers and establish a policy to punish deviations you can write very efficient programs - at near or exceeding asm performance (modern compilers are smarter than developers when it comes to CPU-specific optimizations).
Programming in raw C++ using all its features is probably not productive - the code will not be readable by anyone except Stroustroup himself.
Other languages such as Lisp also allow you to create your own language for specific problems, however they are focusing on expressive power and not on performance.