Hacker News new | ask | show | jobs
by randombytes6869 2185 days ago
Its not just a Rust problem, I've run into the same thing in Java and I'm sure it exists elsewhere. The only answer I can come up with is to keep your app cleanly divided into modules. There's some cognitive overhead but its usually worthwhile.

I recently divided a 100k line Java app into 5 different modules and it compiles 4 times faster. The new boundaries have encouraged better code as well. Suddenly we have things like interfaces and IoC. Before, people just stuffed things wherever.

1 comments

I work with both Java and Rust.

Definitely not the same. With Java, you decide what you want to compile with your build script. You don't need to compile entire application as a single unit. If you have to recompile a lot of code when you only make small modification it is likely because did not use many of available ways to just recompile the classes that you modified.

Also, with Java some optimizations are pushed to runtime. JIT has access to all code running even if it wasn't available at compilation time.

Java also does optimizations at AOT, it is all a matter which toolchain one uses, plenty of choice since 2000.