Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The worst part is how easy it is to add derive and proc macros that kill compile times. I have a ~3k LOC project that blows up to over 45k LOC after `cargo expand` due to a dozen or so macros and the compile time is really starting to hurt iteration speed. Sadly, macros are by far one of my favorite Rust features.

I ended up paying for Clion just to get better debugger integration and a quick action for cargo expanding a file in the UI so I can copy paste the macro results into my codebase. I'm hoping that will improve incremental compilation times until I buy a Threadripper workstation.



Does the expanded code take longer to compile than the equivalent handwritten code? Is it just the expansion itself that takes a long time?

In the latter case, maybe cargo needs an intermediate macro-expansion cache (instead of just a crate-level build cache)


Often, you would write a lot less code if you were doing it by hand.


I adore CLion, it's brilliant for coding. At the moment I'm using it with Python and Git.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: