Hacker News new | ask | show | jobs
by johnny531 5555 days ago
Try stripping debug symbols. As to compile time, the pimpl pattern is your friend here.
1 comments

I don't know who your audience is. I understand that most (about 2/3) of that data is symbol information. The complaint was obviously that a 200 line file generates 8MB of symbols and takes longer to compile than the rest of the project put together. And the existence of this 200 line file is precicely a pimpl attempt to isolate the C++ brain damage as much as possible.

Your point seems to just be agreement with mine: C++ bloat is tolerable. It's still bloat.

Perhaps C++ will finally become a scripting language. So you don't get to complain about the compilation cost.

Seriously, I think it's too much trick to do meta-programming in the language. If meta-programming should be allowed, it should be easier, simpler, and for the ordinary people. Just like Ruby.

I agree very much, good comment. I think meta-programming in a language such as C makes a lot of sense, as you want to be able to generate efficient, compiled code, with as little developer effort as possible. Metaprogramming makes it possible to specialize abstract types, data structures, and so on.

But why does the metaprogramming syntax in C have to be so convoluted, bloated and difficult? Do we really need >30 second compile times per file on recent CPUs? If a language is hard to parse both for computers and humans, something went wrong. It should be easy to read for one of both, preferably both.