3 ms·
You can get the size of a type, the problem is you can't get it at preprocessor time. Which is the result of another problem: the C language operates in two ph
by dietrichepp 12y ago
You can get the size of a type, the problem is you can't get it at preprocessor time. Which is the result of another problem: the C language operates in two phases: preprocessing and compiling (three, if you count linking). Preprocessing, compiling, and linking phases are walled off from each other, resulting in problems. (Preprocessing shouldn't even be a thing that you do to most source code.)
- ploxiln 12y agoMy understanding is that other languages that don't have this separation of compiling objects and linking them together, can't do incremental builds, and are generally quite slow to build.
- kazinator 12y agoWhat are examples of these languages? How can you build anything large, or even large-ish if you don't have compilation units?
- dietrichepp 12y agoC++ is infamously slow to build. I've seen the results of profiling Clang (known as a particularly fast C++ compiler) and the preprocessor takes a big chunk of time. C compiles a fair bit faster. Try out the Mono compiler for C# some time. It is so fast that you might as well recompile your entire project every time you change one line of code. I'd pay serious money to get that kind of performance from a C++ compiler. Tons of other compilers are really fast. JIT is fast all modern browsers. Go compiles in a snap. Python starts running immediately. The only other language I use with a compile time comparable to C++ is Haskell.