4 ms·
If compilers weren't so pathetically slow this wouldn't be that much of an issue. If this became widespread it might have the positive impact on projects like L
by eikenberry 6y ago
If compilers weren't so pathetically slow this wouldn't be that much of an issue. If this became widespread it might have the positive impact on projects like LLVM and get them to pay some attention to compiling time, not just optimization.
- btilly 6y agoThe problem with compile times is mostly not the compiler's fault. It is with the project setup. See http://www.real-linux.org.uk/recursivemake.pdf http://www.real-linux.org.uk/recursivemake.pdf for a classic explanation.
- eikenberry 6y agoBut we haven't learned from this as modern, non-make based build systems still suffer from terribly slow compiles. Take Rust for example. I don't know a single project that uses make to build (they all use cargo), yet Rust suffers from extremely slow compile times. Much of this (as far as I understand) comes from the LLVM compiler, which is why I was picking on compilers.
- btilly 6y agoI have not used Rust very much. But in https://doc.rust-lang.org/cargo/reference/build-scripts.html https://doc.rust-lang.org/cargo/reference/build-scripts.html I find comments like, It is recommended to carefully consider each dependency you add, weighing against the impact on compile time, licensing, maintenance, etc. Cargo will attempt to reuse a dependency if it is shared between build dependencies and normal dependencies. However, this is not always possible, for example when cross-compiling, so keep that in consideration of the impact on compile time. So it looks like cargo can have the same issue that make does with recursive dependencies.
- steveklabnik 6y agoThis is talking about very different issues than the ones identified in that paper. Most of that paper, if not all, does not directly apply to Cargo.
- btilly 6y agoThank you for the insight. I know you know Rust very well. Do you have an explanation for why compile times would be an issue for Rust?
- steveklabnik 6y agoThere’s a lot of factors. https://endler.dev/2020/rust-compile-times/ https://endler.dev/2020/rust-compile-times/ talks about some of them.
- loeg 6y agoRust's slow builds come from rustc, which is based on LLVM. Other LLVM frontends, like clang, are not as slow. This is in part because borrow-checking has a cost.
- eikenberry 6y agoI've seen several LLVM backed languages that suffered from Slow compile tiles (eg. a recent post on Crystal mentioned this) and thought it was generally attributed to LLVM. And I hadn't heard anyone talk about clang as being fast and even you seem to be saying it is still slow, just not as slow as others (damning with faint praise?).
- loeg 6y agoI don't have good data for this, but Clang is much faster compiling C than C++, for example. I don't know if it's fast or slow in any absolute sense; it's not too far off from GCC time-wise and produces approximately-as-good optimized code for my purposes.
- steveklabnik 6y ago(But only a very, very small part, generally.)
- pjmlp 6y agoIt helps that in C and C++ worlds we gladly use binary dependencies, which isn't the case for Rust and cargo based builds, unless you throw something like scache into the process.