logoalt Hacker News

ceronmanyesterday at 9:05 PM2 repliesview on HN

I bet that if you take those 278k lines of code and rewrite them in simple Rust, without using generics, or macros, and using a single crate, without dependencies, you could achieve very similar compile times. The Rust compiler can be very fast if the code is simple. It's when you have dependencies and heavy abstractions (macros, generics, traits, deep dependency trees) that things become slow.


Replies

taylorallredyesterday at 10:24 PM

I'm curious about that point you made about dependencies. This Rust project (https://github.com/microsoft/edit) is made with essentially no dependencies, is 17,426 lines of code, and on an M4 Max it compiles in 1.83s debug and 5.40s release. The code seems pretty simple as well. Edit: Note also that this is 10k more lines than the OP's project. This certainly makes those deps suspicious.

show 1 reply
90s_devyesterday at 9:08 PM

I can't help but think the borrow checker alone would slow this down by at least 1 or 2 orders of magnitude.

show 3 replies