Hacker News new | ask | show | jobs
by Johanx64 1601 days ago
Rust takes an absolute eternity to compile code.

On that count alone I would never-ever consider it in hobby/games project of any sort.

It doesn't matter what features a programming language has, if it takes seconds if not minutes to compile even relatively small projects (less than 50-100k LoC).

3 comments

That is genuinely one of our dilemmas. The product makes enough to spend an extra 20x on machines (and it scales horizontally). So does the impact to developer productivity of Rust offset the 20x cost savings? New features mean new $$$, and more than enough to offset the extra runtime cost of Java.

Personally, I'm now doing hobby projects in Rust because it just feels right. But I've done entire systems in assembly, so I am a bit of a control freak. YMMV.

Why are you doing a clean build? You can't complain about the difference against binary dependencies if you're manually flushing the cache of built dependencies.

And if you're not doing that, you're either wrong, or have a terrible project structure (comparable to including literally every header in every source file in C++)

Isn't compilation time in a roughly similar ballpark for C++? Which is kinda... "quite often" used in games projects? Not sure how much in hobby ones though, if that's what is being discussed here, but I'm somewhat confused (hobby/games sounds like speaking about an either-or alternative?)
Kind of, C++ profits that the ecosystem embraces binary libraries, so usually you only have to care about your own code.

Then if you are using modern C++ tooling like Visual Studio, you can make use of hot code reload.

Here are examples in Visual Studio, and Unreal.

https://www.youtube.com/watch?v=x_gr6DNrJuM

https://www.youtube.com/watch?v=XN1c1V9wtCk