#swiftmacros — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #swiftmacros, aggregated by home.social.
-
I've got a demo gist here of the weirdness with Swift macros not being able to see other macros, and how there's apparent inconsistency.
https://gist.github.com/rhysm94/6d8e3438696bdea998c1816b77119b7a
-
I've got a demo gist here of the weirdness with Swift macros not being able to see other macros, and how there's apparent inconsistency.
https://gist.github.com/rhysm94/6d8e3438696bdea998c1816b77119b7a
-
🚀 I just released Swift Streamable Actors v1.0!
If you’ve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: ✅ 100% Type-safe (no type-erasure/AnyKeyPath) ✅ Memory safe (static factories avoid strong reference cycles) ✅ Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
-
🚀 I just released Swift Streamable Actors v1.0!
If you’ve ever wanted to observe changes to a Swift Actor's state as an AsyncStream without writing 30 lines of boilerplate for every property, this macro is for you.
Key highlights: ✅ 100% Type-safe (no type-erasure/AnyKeyPath) ✅ Memory safe (static factories avoid strong reference cycles) ✅ Clean API: @Streamable does it all.
Check out the code: https://github.com/malhal/swift-streamable-actors
-
Daniel Steinberg @dimsumthinking is speaking at @iosdevuk . as well as the workshop on Swift Testing, Daniel is speaking about Getting the most from Swift Macros. The conference is from 2nd to 5th September. For information and tickets, see https://www.iosdevuk.com/
-
Daniel Steinberg @dimsumthinking is speaking at @iosdevuk . as well as the workshop on Swift Testing, Daniel is speaking about Getting the most from Swift Macros. The conference is from 2nd to 5th September. For information and tickets, see https://www.iosdevuk.com/
-
I made a simple experimental #swiftdata macro to learn how to use #swiftmacros, `@Queried`: https://github.com/juanarzola/Queried
This keeps an array stored property of an object always up-to-date with the contents of a `FetchDescriptor` (as long as you await the function it generates). Unlike `Query` macros, the `FetchDescriptor` isn’t an argument to the macro so that the client code of the generated function can define the arguments at the call site.
I haven't used this in any prod projects yet so consider this experimental :)
Also thanks to @pointfreeco for it's wonderful swift-macro-testing library, it made testing the macro so much easier.
-
I made a simple experimental #swiftdata macro to learn how to use #swiftmacros, `@Queried`: https://github.com/juanarzola/Queried
This keeps an array stored property of an object always up-to-date with the contents of a `FetchDescriptor` (as long as you await the function it generates). Unlike `Query` macros, the `FetchDescriptor` isn’t an argument to the macro so that the client code of the generated function can define the arguments at the call site.
I haven't used this in any prod projects yet so consider this experimental :)
Also thanks to @pointfreeco for it's wonderful swift-macro-testing library, it made testing the macro so much easier.
-
Expectation: Writing #swiftmacros is hard, I'll probably spend hours understanding confusing AST types
Reality: Writing #swiftmacros is hard, I sure spend 50% of the time searching for stray whitespace in macro outputs in tests 🤪
#swiftlang -
Expectation: Writing #swiftmacros is hard, I'll probably spend hours understanding confusing AST types
Reality: Writing #swiftmacros is hard, I sure spend 50% of the time searching for stray whitespace in macro outputs in tests 🤪
#swiftlang -
If you missed hearing from @swiftandtips at the March @iosdevhappyhour event or if you've been wanting to hear it again (and why wouldn't you?) then it's your lucky day!
Big thanks to Pitt for agreeing to share some of his knowledge about Swift Macros with us.
-
If you missed hearing from @swiftandtips at the March @iosdevhappyhour event or if you've been wanting to hear it again (and why wouldn't you?) then it's your lucky day!
Big thanks to Pitt for agreeing to share some of his knowledge about Swift Macros with us.
-
Here's a real-life example of using `StaticMemberIterable` in a Swift script I'm writing to manage some Terraform.
https://fullqueuedeveloper.com/tech-notes/real-life-staticmemberiterable/ -
I dived into #SwiftMacros after its WWDC intro. I decided to really test it on the mocks layer of my project and I got superb results!
I managed to cut 12K lines of code by adding only 2.5K. Half of these are for macro tests. Also, binned ~160 mock files generated by Sourcery.
Few logically understandable limitations, but zero compromises. SwiftMacros is a game-changer. It feels like pre-Macros Swift vs post-Macros Swift. 😅
Excited for what's next with it!
-
Just tried out the new #SwiftMacros!
I created a little something that allows us to "safely" use #SFSymbols in Swift. It will validate that the symbol in fact exists on compilation.
Here you go 😉
-
Just tried out the new #SwiftMacros!
I created a little something that allows us to "safely" use #SFSymbols in Swift. It will validate that the symbol in fact exists on compilation.
Here you go 😉
-
Vi raccontiamo le nostre prime impressioni su #WWDC23. #AppleVisionPro e #AugmentedReality sono finalmente un prodotto reale. #Xcode15, #iOS17 e #SwiftMacros. Cosa ci aspetta con i nuovi frameworks ed il nuovo ambiente di sviluppo? Ne parliamo in una nuova puntata del nostro #podcast…Buon ascolto!
-
I wasted last night struggling to setup #Swift Macros in Xcode 15 without Package.swift — hopefully this helps some of you avoid the same pain! 🍻
-
I wasted last night struggling to setup #Swift Macros in Xcode 15 without Package.swift — hopefully this helps some of you avoid the same pain! 🍻