Hello, Swift community!
The second review of SE-0415: Function Body Macros begins now and runs through May 20, 2024.
The original proposal was returned for revision based on feedback during the review about whether the proposed body
and preamble
macros were sufficient to meet the needs of macro authors, with many community members expressing a desire for "wrapper" macros similar to Python decorators. Based on early experimentation, the proposal authors believe that there may be a path toward wrapper macros that could provide the same or more expressivity as was originally proposed for preamble macros.
The authors also believe that body
macros from the original proposal are useful in their own right, even if future work allows some of their use cases to be absorbed by more specific types of function macros introduced later.
For this reason, the Language Steering Group is running a second review of this proposal which has been scoped more narrowly to include only the body
macros feature. The proposal has been updated to move the discussion of preamble macros to the future directions section and also to add a discussion of wrapper macros there.
A diff of the proposal can be found here.
Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to me as the review manager by DM. When contacting the review manager directly, please put "SE-0415" in the subject line.
Trying it out
If you'd like to try this proposal out, you can download a toolchain supporting it from Swift.org; the most recent Trunk Development (main) snapshots support the feature. You will need to add -enable-experimental-feature BodyMacros
to your build flags.
What goes into a review?
The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
- What is your evaluation of the proposal?
- Is the problem being addressed significant enough to warrant a change to Swift?
- Does this proposal fit well with the feel and direction of Swift?
- If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
- How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
More information about the Swift evolution process is available at
swift-evolution/process.md at main ยท apple/swift-evolution ยท GitHub
Thank you,
Tony Allevato
Review Manager