5 ms·
If you have a single source file that's big enough for the compiler to bog down on it, then either that compiler is beyond ridiculously slow, or you need to ref
by taneq 10y ago
If you have a single source file that's big enough for the compiler to bog down on it, then either that compiler is beyond ridiculously slow, or you need to refactor.
- pcwalton 10y agoThe tricky part is the dependencies between files. This is what C++ uses header files for, but Rust doesn't have those.
- skybrian 10y agoLanguages like Go and Java can do separate compilation by reading header information out of the object files of imported packages/classes.
- pcwalton 10y agoRust has been doing that since day one. What makes this incremental compilation different from that of, say, Go, is that it works inside a package. Before incremental compilation, Rust and Go had the exact same model: package-at-a-time compilation. With incremental compilation, Rust is more fine-grained than that: Rust can compile specific parts of a package while leaving the other parts untouched.