Hacker News new | ask | show | jobs
by steveklabnik 2071 days ago
There's a couple of challenges here with Rust. None are insurmountable, but there are just other things that are higher priority.

There are 15,000 packages on Hackage, but 48,000 on crates.io. According to http://www.modulecounts.com/ hackage is getting about four new packages a day right now, and crates.io is getting 54. This means that expense is more of an issue.

I don't know about Haskell, but in Rust, many projects tweak various compiler flags, for performance, or whatever. You'd need to get the exact flags the same too. It's possible there's a long tail effect here.

https://doc.rust-lang.org/nightly/rustc/platform-support.htm... is way longer than https://gitlab.haskell.org/ghc/ghc/-/wikis/platforms (I am not 100% sure the latter is canonical). This isn't a hard stopper, and there's probably a long tail effect here, but it's still a factor in you getting a precompiled binary or not.

Rust relies more heavily on inlining than Haskell does, and relies heavily on monomorphization This means more work to do during compilation; it also means that even for a "precompiled binary", you still end up needing to do a lot of work on the final compilation.

There are existing tools like sccache that you can use to implement a binary cache, so people that really want this feature also have the ability to get it, and some do. It's just not a globally available thing.

If you look at Rust's compile times, generally, even once your dependencies are compiled, it's still slower than we'd like. You only compile dependencies once, and so, while binary libraries may help your initial build, they don't really affect later builds at all, and that's most builds. So more effort is going into improving that, rather than focusing on pre-compiled dependencies.

That's off the top of my head...

1 comments

If Rust does more inlining than Haskell, it does _a lot_ of inlining! Haskell doesn't monomorphise (it calls it specialise) much by default though.
FWIW, that is mostly gut feeling, I don't have good data on that. I probably should have softened that sentence. And it's not really that Haskell is missing some sort of optimization here, it's that these things all tie together: Rust tends to monomorphize a lot, which produces more code in general, including stuff to get inlined. It's one of the big challenges to get things to compile quickly; they're sort of inherently in tension with one another.