- cross-posted to:
- rust
- [email protected]
- cross-posted to:
- rust
- [email protected]
I get it – abstractions are cool. They’re supposed to hide complexity so we can focus on cooler stuff. And Rust loves that idea. Traits, generics, lifetimes – layer upon layer of “don’t worry about it honey.”
That’s such a fundamental misunderstanding of something so basic, that I almost had to stop reading.
Per request: “nice post”
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.


