News for hackers. Stuff that matters.
Re:C++ vs. Rust Build Times by misja111 on Friday January 06, 2023 @02:46AM (#34272053)
As a Scala developer, I can only dream about these build times. 1.8s to build a 17K LOC project .. This would take minutes for my similarly sized Scala project.
Re:C++ vs. Rust Build Times by strager on Friday January 06, 2023 @03:54AM (#34272516)
I'm sorry to hear that!

Did you try upgrading your hardware? It really helps.

Re:C++ vs. Rust Build Times by odersky on Friday January 06, 2023 @05:23AM (#34273087)
This looks completely out of the ordinary. With a warm compiler, on a 4 year old Macbook Pro, I get 2000-4000 lines/sec. I.e. 4-8 seconds for your project. Unless you do some very involved typelevel or meta-programming stuff that's what you should expect to see.
Re:C++ vs. Rust Build Times by misja111 on Friday January 06, 2023 @05:52AM (#34273289)
Yes my project does contain a bit of typelevel stuff (Cats Effect). And it's Scala 2.13, so not the latest 3.x which might compile a bit faster. Also to be fair, I was referring to the time taken by sbt compile, which I suppose does more than just invoking scalac. But still the time reported by sbt's Compile/ Compile incremental is over 200s.
Re:C++ vs. Rust Build Times by gpderetta on Friday January 06, 2023 @08:31AM (#34274364)
to be fair, C+ header only libraries full of advanced template metaprogramming will also slow down compilation by a few order of magnitude.
Re:C++ vs. Rust Build Times by bluGill on Friday January 06, 2023 @09:22AM (#34274840)
I'm hopeful modules will come fast, they seem to fix that issue. Modules are already in C++20, but most compilers don't support them well enough yet.
Re:C++ vs. Rust Build Times by gpderetta on Friday January 06, 2023 @09:30AM (#34274929)
I suspect they will help with the parsing, but not with template instantiation cost which dominates metaprogramming.
Re:C++ vs. Rust Build Times by pjmlp on Friday January 06, 2023 @10:22AM (#34275608)
That is what external templates are for, pre-instantiate all common cases in a binary library.
Re:C++ vs. Rust Build Times by odersky on Friday January 06, 2023 @09:08AM (#34274691)
I think 2.13 and 3.x are about par on compilation speed. sbt does add overhead, reportedly it can slow down compilation speed by half.
Re:C++ vs. Rust Build Times by vegerot on Friday January 06, 2023 @06:53PM (#34283138)
Martin?