kettle11 / kapp

A pure Rust window and input library for Windows, Mac, and Web. (Work in progress)
Apache License 2.0
56 stars 4 forks source link

objc macros are fairly heavy in terms of generated code. Should they be used? #33

Open kettle11 opened 3 years ago

kettle11 commented 3 years ago

The events_mac file expands with cargo expand to ~3300 lines due to macros when the non-expanded version is ~660 lines.

I partially began a transition away from using the objc macros in 0d96c59ad1d8a26525118eba0dbfa75856716a3d however I did not fully complete the transition. The partial reduction of the macro shaved ~6% off the build time.

However I'm now having second thoughts. Now to use new classes and selectors code must be declared in multiple additional places instead of one macro that handles it all. It makes kapp's code base aesthetically a bit messier and adds a little friction to implementing new changes.