Ask HN: The most powerful use of macros / code generation you've had
1•Rendello•3h ago
Comments
Rendello•3h ago
I'm about to try my hand at procedural macros in Rust (as a last resort), and I started thinking about code generation.
Although I've never done much with macros, I have on occasion used Python to generate big Rust files. In one project, I had a web extension that would transliterate between two (mostly equivalent) writing systems in a given language, and I had Python read a small CSV table and generate some big perfect hash maps with a lot of data.
Rendello•3h ago
Although I've never done much with macros, I have on occasion used Python to generate big Rust files. In one project, I had a web extension that would transliterate between two (mostly equivalent) writing systems in a given language, and I had Python read a small CSV table and generate some big perfect hash maps with a lot of data.