Point-Free

Point-Free

@pointfree.co

A video series exploring advanced topics in the Swift programming language, hosted by @mbrandonw.bsky.social and @stephencelis.com. Save 30% off today! https://www.pointfree.co/discounts/black-friday-2025

1.2K followers221 following809 posts

Pinned

We compare SwiftData’s new features with SQLiteData, starting with a domain modeling exercise. We will rewrite the Trips @‌Model classes into simple @‌Table structs, and we will explore how the Draft type can power a single form for both creating and updating trips: www.pointfree.co/episodes/ep3...

Did you know Swift actors can share the same isolation and communicate with one another in a completely synchronous manner? This week we apply the idea to ComposableArchitecture 2.0, where a scoped StoreActor can wrap a parent and share parts of the same core domain and state.

This week we conclude our series by showing how to share isolation across boundaries! By abstracting our nonisolated core with a protocol, isolated shells can scope down to subfeatures while retaining all the benefits of controlled isolation. www.pointfree.co/episodes/ep3...

pointfree.coVideo #384: Designing for Isolation: Shared IsolationWe conclude our series by showing how we can share isolation across boundaries. We will abstract our nonisolated core with a protocol so that our isolated shells can scope down to subdomains and subfe...

Come learn how to accomplish the seemingly impossible with Swift macros: • Customize macro logic based on static type information • Access static type information from inferred types Both things you cannot typically do by looking purely at the syntax! 🤯

Swift Language@swift.org

@pointfree.co's series on advanced macro techniques wraps up with part 2: type inference. A great read for Swift macro authors. Check it out at www.pointfree.co/blog/posts/2...

A benefit of defining your app’s business logic using “Nonisolated Core, Isolated Shell” is that you can take advantage of Swift Testing’s parallelization in ways you can’t when all your code is isolated to the MainActor. This can lead to a test suite that runs 10⨉ faster!

This week we started reaping the benefits of "nonisolated core, isolated shell". We write features a single time, without thinking about isolation, then wrap the feature in the isolation we need. @‌MainActor for SwiftUI, arbitrary actor for tests! www.pointfree.co/collections/...

Advanced Swift macro technique: Accessing inferred types Macros only see the syntax of Swift code, so it seems impossible to access inferred types. But with a clever trick involving associated type inference, we can achieve the seemingly impossible! www.pointfree.co/blog/posts/2...

Which error would you prefer to diagnose? The one that is presented on the problematic line, or the one hidden in the guts of expanded macro code?

Point-Free@pointfree.co

Part 1 of our Advanced Swift Macros series is out! You may think macros can only see the stringy syntax of Swift code, but it is possible to tease out some static type information. You can even detect if a type conforms to a protocol! 🤯 www.pointfree.co/blog/posts/2...

Part 1 of our Advanced Swift Macros series is out! You may think macros can only see the stringy syntax of Swift code, but it is possible to tease out some static type information. You can even detect if a type conforms to a protocol! 🤯 www.pointfree.co/blog/posts/2...

pointfree.coAdvanced macro technique #1: Static type informationThe first advanced Swift macro technique we will discuss is how macros can peek at a small amount of static type information, such as checking if a type conforms to a protocol or not. This seems to…

This week we explore the “Nonisolated Core, Isolated Shell” pattern in Swift using a type that drives the business logic of a SwiftUI app. A nonisolated “Core” type is hosted in an isolated “Store” type, simplifying the complexities one typically encounters in Swift concurrency.

We've got a new series of blog posts coming up: Advanced techniques in Swift macros We will show off a few clever tricks for teasing static type information in macros, something that is commonly thought to be impossible! www.pointfree.co/blog/posts/2...

pointfree.coAdvanced techniques in Swift macrosToday we are embarking on a 2-part blog series to explore advanced macro techniques. We will show how to go beyond the limitations of Swift macros by showing that they can get access to static type in...

Modern concurrency tools like nonisolated(nonsending) and Task.immediate got us closer to our goal, but not all the way. So we’re trying a new approach inspired by Gary Bernhardt’s “functional core, imperative shell”: Nonisolated core, isolated shell. www.pointfree.co/episodes/ep3...

We tried using two modern Swift concurrency tools to allow us to embrace non-sendability: • nonisolated(nonsending) • Task.immediate They got us close to our goals, but sadly there were still data races. Watch this week's episode to understand why: www.pointfree.co/episodes/ep3...

Our code is at an impasse: we want to embrace non-sendability, but async work seems to force us into Sendable. We’ll revisit our approach to this problem from ComposableArchitecture 1.0, see why it's not ideal, and search for a better way. www.pointfree.co/episodes/ep3...

We’ve started a new series: Designing for Isolation Learn how designing for isolation from the beginning lets you embrace non-Sendable types, maintain thread safety, and keep asynchrony from infecting every corner of your codebase. Follow along here: www.pointfree.co/collections/...

Last month we shipped 40 releases across 16 of our open source libraries, including new JSON and DB collation tools, preview traits in Dependencies, and the completion of a years-long package rename. Here’s a recap of everything that happened. www.pointfree.co/blog/posts/2...

pointfree.coLast Month in Point-Free: AugustLast month we shipped 40 releases across 16 of our open source libraries, including new JSON and collation tools for our modern persistence libraries, the return of preview traits in Dependencies, and...

Compare to SwiftUI’s LazyState (wrapped in a macro by us), where we get to drop all the Optional dancing, potentially buggy “onAppear” logic, and generally write things as succinctly as possible:

The pattern Apple has established for influencing a view’s @‌State from a parent: 1. Make the state private and Optional 2. Populate the state in onAppear This means extra boilerplate, imprecise domains, optional coalescing and chaining dances, and potential lifecycle bugs!

Xcode 27 beta 6 quietly changed how SwiftData's sectioning APIs work. Did you notice? The @Query macro must now explicitly use the SectionedResults type, which means it is no longer possible to dynamically add/remove sectioning from a view.

There was an unexpected hubbub last week when we said lazy @‌State only works for private variables. Well, we're back at it. We feel @‌State still doesn't adequately solve the problem of dynamically initialized state, so we are introducing @‌LazyState: www.pointfree.co/blog/posts/2...

pointfree.coBeta Preview: LazyStateAnnouncing the newest addition to Point-Free Beta Previews: LazyState, a library that picks up where WWDC’s new @State macro left off by allowing state in SwiftUI views to be initialized lazily and…

We explore the problems not solved by the new @‌State macro and explain why we think they should be solved. To close this gap we introduce a new @‌LazyState macro, which allows you to delay initialization of your state, all without introducing any new API! 👉 www.pointfree.co/episodes/ep3...

You've probably heard by now that SwiftUI has a fancy @‌State macro that lazily creates state, fixing a longstanding issue in the framework. But what you may not know is that the laziness only kicks in for **private** state. Get all the details here: www.pointfree.co/episodes/ep3...

The new @‌State macro fixes a long-standing bug in SwiftUI, that of objects being needlessly allocated. But have you looked at the expanded macro code yet? Looks like gobbledygook! We show that all of this code is essentially just 3 lines of code: 👉 www.pointfree.co/episodes/ep3...

We built a geofence for our Trips app that turns red if it doesn’t contain the trip. Impressive stuff, but complex enough to deserve some tests! We show how to exhaustively test it like a value type, so a missed assertion is a test failure with a nice message. 🤯

Many took SwiftData queries being limited to SwiftUI views as proof that everything belonged in views. But appleOS 27 now allows queries to live outside views, which is something SQLiteData has supported since day one and back-deploys to iOS 16! www.pointfree.co/episodes/ep3...

Announcing: Episode Search! This was probably our most requested feature. Have you ever wanted to revisit a topic but forgot which episode discussed it? You can now search our entire catalog of video transcripts, from speech to code. Try it out today: www.pointfree.co/blog/posts/2...

This year SwiftData introduced a brand new way to observe changes outside of the view where @‌Query cannot be used. What’s SQLiteData have to say about that? To explore, we’ll build a moderately complex geofence map editor and get full test coverage of the feature. www.pointfree.co/episodes/ep3...