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

Macros are extremely important to make rust productive. It sometimes feels as if you were writing in a higher level language.

One of the best examples is the serde crate. What a beautiful library!



Macros are powerful, but they should be used sparingly because they often have outsize effects on compilation times and degrading error message quality. I personally give myself a "macro budget" where macro-based solutions are prioritized based on benefit to a particular project.


With great power comes great responsibility.

Based on my experience with macros, across several languages with support for them, macros are beautiful until you need to debug them under time pressure on a critical customer issue on a code base that you never seen before.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: