Macros in Swift are this yr’s massive language characteristic. I’m certain you’ve already watched the wonderful Write Swift macros and Increase on Swift macros WWDC session movies, however what comes after that?
We instantly put them in our manufacturing code and hope for the most effective, proper? 😬
I wrote one thing comparable when Swift 5.4 launched end result builders, and we noticed a proliferation of experiments. Now we’re in that very same interval with macros.
The package deal index is already filling up with packages that include macros, and it makes me glad we added 5.9 help so rapidly. A number of the packages I’m linking to under will change into important elements of the Swift package deal ecosystem, and a few will stay experiments. It’s not possible to know which but!
There’s every little thing from full-featured packages like SwiftRequest and papyrus that allow you to outline a type-safe HTTP shopper with operate annotations to smaller utility packages like AssociatedObject, which permits variable storage in extensions. There are numerous, many extra although. Right here’s a listing of others I noticed this week:
There’s one other benefit of getting these packages accessible as open-source. They’re instructional assets, too! Are you interested by the way you would possibly need to use macros in your apps? Have a look by way of the supply of a number of the packages linked above. I’m certain you’ll be taught one thing.
