Versioning libraries that use macros (and SwiftSyntax)?

Is there any discussion or documentation around how a library should be versioned to support macros (and other SwiftSyntax code) across multiple versions of Swift?

For example, if a library is written for Swift 5.9 using SwiftSyntax from 509.0.0, will a Swift 5.10 project be able to use the macro? What if the macro is passed Swift 5.10-only syntax? Is it possible for a library to ship a macro that simultaneously works in 5.9 and 5.10 (and more Swift versions)?

The main project out there that I know of that uses SwiftSyntax is swift-format, which is pretty strictly versioned by Swift version...are libraries that ship macros going to have to do something similar?

8 Likes