Re:The Brick Wall of C++ Source Code Transformation
by mynegation on Thursday November 19, 2015 @11:25AM
(#10595639)
I have been one of the primary authors of a commercial C++ static analysis tool.
In a nutshell: C++ is horribly complicated language, and preprocessor is just the first brick wall on the way. Even if you walk around it or manage to blow a hole through it, there are other things. The fact that C++ even as a preprocessed language is very complicated. Its grammar is context-sensitive. You have to scan C++ definitions at least twice to parse them properly. And then you bump into a mother of all brick walls: templates. Which are turing-complete. Meaning that you can specify arbitrary computation in them, that will be performed by the compiler.
In a nutshell: C++ is horribly complicated language, and preprocessor is just the first brick wall on the way. Even if you walk around it or manage to blow a hole through it, there are other things. The fact that C++ even as a preprocessed language is very complicated. Its grammar is context-sensitive. You have to scan C++ definitions at least twice to parse them properly. And then you bump into a mother of all brick walls: templates. Which are turing-complete. Meaning that you can specify arbitrary computation in them, that will be performed by the compiler.