News for hackers. Stuff that matters.
Re:C++ vs. Rust Build Times by pharmakom on Friday January 06, 2023 @05:24AM (#34273090)
I think it’s acceptable for Rust compilation to end up slower than C++. After all, the compiler does a lot more work for you with the borrow checker and all. That doesn’t mean we shouldn’t strive to make it better though.
Re:C++ vs. Rust Build Times by strager on Friday January 06, 2023 @05:57AM (#34273327)
I'd wager that the C++ compiler does more work churning through #include-s than the Rust compiler does tracking borrows.
Re:C++ vs. Rust Build Times by bluGill on Friday January 06, 2023 @09:27AM (#34274890)
C++20 modules is supposed to fix that. I wish I could get compilers that implemented them.
Re:C++ vs. Rust Build Times by pjmlp on Friday January 06, 2023 @04:42PM (#34281609)
Re:C++ vs. Rust Build Times by bluGill on Friday January 06, 2023 @06:10PM (#34282705)
I target linux with my C++.
Re:C++ vs. Rust Build Times by pjmlp on Saturday January 07, 2023 @04:39AM (#34286629)
That wasn't part of the comment.
Re:C++ vs. Rust Build Times by Narishma on Friday January 06, 2023 @06:11AM (#34273446)
What makes you think it is slower because of the borrow checker?
Re:C++ vs. Rust Build Times by antonvs on Friday January 06, 2023 @07:02AM (#34273776)
It’s not because of the borrow checker specifically, but the type system design that makes the borrow checker possible is a big part of what leads to slower compilation times.

On the other hand, that extra time is traded off against not having to deal with bugs at runtime that the type system is able to catch. Rust is one of the better languages when it comes to making illegal states unrepresentable.

Re:C++ vs. Rust Build Times by vegerot on Friday January 06, 2023 @06:55PM (#34283148)
I know the article is really detailed, and I don’t remember a lot of it either!

But he does specifically break down how much of compilation time is spent in the borrow checker, LLVM, macro expansion, etc.

Re:C++ vs. Rust Build Times by dgb23 on Friday January 06, 2023 @06:50AM (#34273708)
cargo check seems to be quite fast in comparison to compilation?