this post was submitted on 25 Oct 2025
13 points (93.3% liked)

Rust Programming

9028 readers
14 users here now

founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Ephera@lemmy.ml 2 points 2 weeks ago

Been hacking away at a library and definitely feeling this one. Some APIs, I'm not yet terribly happy with, and there's always this urge to introduce a macro to hide away the ugly API.

So far, I'm still staying away from it, because I'm just thinking that users will not have an easier time either way. The code they write may look prettier, but if they have to learn custom syntax rules for it, then it isn't easier to understand in the end.
Also, while a macro can clean up some rough edges, it won't fix up an API that's illogical to begin with. Well, unless you make it a turing-complete macro (i.e. proc_macro rather than macro_rules), but that makes it infinitely harder to understand once more.