# A Possible Vision for Macros in Swift

**URL:** <https://forums.swift.org/t/a-possible-vision-for-macros-in-swift/60900>\
**Category:** Pitches\
**Created:** [October 17, 2022, 7:00pm UTC](https://forums.swift.org/t/a-possible-vision-for-macros-in-swift/60900 "2022-10-17T19:00:12Z")\
**Posts on this page:** 1\
**Showing post:** 74

<div class="post-metadata">

**Author:** ![jjrscott](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jjrscott/32/12494_2.png) [@jjrscott](https://forums.swift.org/u/jjrscott)\
**Post date:** [October 29, 2022, 11:17am UTC](https://forums.swift.org/t/a-possible-vision-for-macros-in-swift/60900/74 "2022-10-29T11:17:23Z")

</div>

After reading A possible vision for macros in Swift again (excellent breakdown by the way) I persuaded **against** introducing general macros. I'm minded that the urge for macros shows us where we need to improve Swift in ways that shouldn't need macros.

For example, one of the examples given - clamping values, is a runtime action. There’s nothing really in _need_ of compile time behaviour, the optimiser should (either now or in the future) be able to handle static values to improve performance.

The only thing I think we’re in _need_ of are compiler generated member-wise initialisers and handlers - eg a KeyPath equivalent of Codable (and TBH 99% of CodingKeys are one to one and on to KeyPaths anyway, and that's effectively what the Swift compiler generates).

---

_[View the full topic](https://forums.swift.org/t/a-possible-vision-for-macros-in-swift/60900)._
