Overused as external API or just in general? I've found them pretty useful for bits of my crates, but I don't think I've exposed any in a public API.
-
-
-
I don’t even use them internally. I find them too obfuscating :)
-
Definitely. Admit it or not, everyone just expands them in their heads to understand the meaning.
End of conversation
New conversation -
-
-
Unpopular mitigation: everywhere someone would use a macro to abstract over syntax, it should be obviated by introducing or generalising language features to let them abstract over semantics instead (e.g. higher-kinded types, higher-rank polymorphism, first-class patterns…)
-
That’s how I ended up at dependent types! Still need to patch up some stuff with elaborator reflection though :/
-
We are still a ways off being able to truly do type theory in type theory, so you still need some level of support for automation - be it macro expasion or at elaboration time...
End of conversation
New conversation -
-
-
If everyone is using macros, it might be evidence that the type system is not sophisticated enough. It could also be that not everybody understands what idiomatic Rust should be, so they exploit macros to try to make the language closer to what's in their head.
- 1 more reply
New conversation -
-
-
Popular opinion: Sometimes the type system keeps us from reusing the same code (because we cannot get the types to match). This leaves us with macros, code generation or copy & paste. The latter carries its risk, so the former are sometimes valuable.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Every time I use a macro I feel bad and want to find a way to replace it with anything but a macro. The only exception is if it’s a macro that thunks arguments to a std macro
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Same problem in Scala.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
So far the only time I used one was to make my own '?' style operator that exits a command line program properly.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yeah I mostly stay away as well unless a macro actually has a substantial gain
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Is that probably because lang doesn't have HKT inside? So we have another approach, macros way...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
"Too much" suggests that there's something wrong about using macros. But in Rust they're easy to write and use. I don't see many disadvantages.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I was gonna ask you to help maintain this crate but I guess you can't :P https://docs.rs/static_assertions/ …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Does it make your builds faster and debugging saner?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
There are some really useful things they do though, then there are some mind blowing ones, like html! In yew.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Sadly, macros are promoted by: every single use of print, every single vector allocation, lack of functions overloads, lack of functions with variable number of arguments...
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.