gtk-rs-core
gtk-rs-core copied to clipboard
[PROPOSAL] Consider moving some/all of glib::wrapper to a proc macro
Altogether these macros are huge, it is difficult to add features or refactor them. Every new argument must put through around 6-8 pattern matches to work, see for example some of the changes here: https://github.com/gtk-rs/gtk-rs-core/pull/609/commits/3c41d6deaa2f4c7c7d726c1f124998f52ba31762
If we ever want to add support for lifetimes and PhantomData
that will need to have all the macros changed again as per https://github.com/gtk-rs/gtk-rs-core/issues/610#issuecomment-1272370600.
@GuillaumeGomez is talking about that since quite some time, just nobody got to it yet :)
Tried out here https://github.com/gtk-rs/gtk-rs-core/pull/970/commits/cc620d4f9e3fabf78394ed184e850c144b3bcb6f but it seems around 15% - 20% slower than the macro_rules
implementation. Not sure what the cause of the slowness is, if it is avoidable or if it is just overhead from the proc macro bridge