https://build.rs/ is a handy Rust pattern for compile-time code generation. E.g. https://rust-lang-nursery.github.io/rust-bindgen/tutorial-3.html
It's a small standalone program that prints lines of Rust code! It reminds me of much more dynamic languages.
Related Posts
Over a sufficiently long time horizon, all code you write is legacy code.
It's really satisfying to use a profiler for the first time on a project. I always find a big performance win with only a small code change.
It's never the code that I expected to be slow, however!
Claude asked me a question today: was I looking for an Emacs plugin (because I was talking about elisp) or a Rust program (because I have configured Rust preferences)?
I'm really impressed, it's rare to see LLMs ask follow-up questions.
(I wanted Emacs in this case.)