People complain that rustc is slow, eats all your memory, and fills up your hard drive.
The problem is, the most realistic way to speed up compilation is caching, and that data has to go somewhere. It’s a balancing act.
My beloved Zig famously has a very fast compiler, yet it suffers from the exact same problem. The cache dir gets huge, very fast. The first things I search for when my computer is running out of space are .zig-cache and turborepo dirs.
To avoid redoing work, you have to save the work you did.
Honestly, since Silk is changing every day, I’m nuking everything all the time and haven’t even stopped to check how its disk usage grows. Because I rely heavily on incremental compilation to keep it fast, I don’t expect it to be light. Right now I’m focusing a lot on memory usage and compile speed. Those directly affect how much you get done because they sit right in your (and your agents’) development loop. Disk space is just annoying. And in an AI world where work is parallel and distributed across throwaway sandboxes and VMs, compute time is expensive and disk space is cheap (although I imagine devops would immediately complain about IO cost. Truth be told, I’m not really a devops girl so take it with a grain of salt). If I have to compromise somewhere, I’ll trade disk space every time.
If you want to blame someone, blame LLVM. But I remember well when Andrew proposed the idea of getting rid of LLVM as a requirement for zig to work (which was misunderstood at the time as if it wouldn’t be possible to use LLVM with zig at all), people were pissed too.
I’m not saying there isn’t a solution, or at least a way to make it better. My plan for Silk (though I’ll admit I haven’t thought much about disk savings yet) is to make it easy to find and evict stale cache without wiping out the cache that keeps the compiler fast.
The one place I think Rust could do better is its type system. Monomorphizing (ugliest word) Rust code is particularly expensive, both to compute and to cache, and worse, that cost is hard to see. With Zig’s comptime, the trade-off is right there in the name. Everything you do at compile time costs compile time. With Rust, picking a particular combination of generics can quietly blow up your monomorphization cost. That’s where Silk is trying to do better, though that’s just the advantage of a greenfield project that gets to learn from others’ past mistakes.
I mean, I get the frustration. I feel it too, especially now that worktrees make the problem even bigger. Still, it’s not an easy problem to solve, and I suspect that if it were up to you, you’d make the same choice.
Maybe I’m wrong, and as Jared says, caching is just coping for a slow compiler 🙄