▲ | steveklabnik 4 days ago | ||||||||||||||||
> I find C compilation extremely fast exactly because of headers. The header model is one of the parts that makes compiling C slower than it could be. This doesn't mean that it is slow, but it's fast in spite of headers, not because of them. > In C you can split interface and implementation cleanly between header and c-file and this enables efficient incremental builds. That's not what does, it is the ability to produce individual translation units as intermediary files. > Rust also does not seem to have proper separate compilation. Rust does separate compilation, and also has efficient incremental builds. Header files are not a hard requirement for this. | |||||||||||||||||
▲ | uecker 4 days ago | parent [-] | ||||||||||||||||
If you say the header model makes it slower than it could be, you need to compare it to something. I do not see how it causes significant slow downs in C projects (in contrast to C++). And yes, I wrote compilers and (incomplete) preprocessors. I do not understand what you mean by your second point. What separation of interface and implementation allows you to do is updating the implementation without having to recompile other TUs. You can achieve this is also in different ways, but in C this works by in this way. I am not sure how it works in Rust as you need to monomorphize a lot of things, which come from other crates. It seems this would inevitably entangle the compilations. | |||||||||||||||||
|