[Accepted] SE-0382: Expression Macros

Hello Swift community,

The second review of SE-0382: Expression Macros ran from February 10...20, 2023.

Feedback was lighter than in the first review and positive with respect to the revisions made, and the language workgroup has decided to accept the proposal as revised.

There was further feedback in this review period regarding the spelling for declaring freestanding macros generally, of which expression macros would be one kind. The language workgroup will continue to review this aspect of macros as we consider declaration macros, attached and freestanding.

Other feedback concerned what are possible future directions beyond this proposal, including deprecating built-in language features such as #colorLiteral in favor of a macro-based solution, improving MacroExpansionContext to permit queries about subexpression types, and possible additions to the AbstractSourceLocation API. The language workgroup is satisfied that approval of this proposal as it is won't limit the possibility of exploring these directions as future work.

As part of the first review, the language workgroup laid out our rationale for the scope of review of this feature, which has been designed to allow Swift Syntax to iterate independently on its own API. A late-breaking piece of feedback was that makeUniqueName(_:) would be more consistent with Swift's API naming conventions than createUniqueName(_:). Overall, the proposal author and the language workgroup both agree with the feedback; as this concerns a Swift Syntax API that can evolve independently, we are pleased that incorporating the suggestion will not require Evolution re-review. However, the proposal text will be amended to reflect this naming change for clarity.

As always, thank you for participating in the review process.

Xiaodi Wu
Review Manager