[swift-evolution] Why aren't source to source transformations part of the Swift language standard?

Amir Michail a.michail at me.com
Tue Dec 29 13:40:18 CST 2015


> On Dec 29, 2015, at 2:34 PM, Jacob Bandes-Storch <jtbandes at gmail.com> wrote:
> 
> I would not recommend phrasing these proposals as "Why doesn't Swift already support X?" when you are proposing a new feature.
> 
> Instead, I'd like to see much more fleshed out examples of what you'd propose to change, and how it would help Swift developers. From the small amount of information you've given here, I can't understand what you're trying to do.

Xcode is not open source and it is unlikely that Swift source to source transformations that will be part of Xcode in the future  (e.g., extract method) will be open source.

What I propose would be a way to embed source to source transformations into Swift using directives in the language. As the language is open source, so will be the transformations.

Note also that the compiler already has the information required for source to source transformations and so it makes sense to embed these transformations in the compiler itself.

> 
> Jacob
> 
> On Tue, Dec 29, 2015 at 10:07 AM, Amir Michail via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> Source to source transformations are part of a developer’s job, don’t need a GUI, and can be done more easily and accurately by the Swift compiler. Moreover, the compiler could be made interactive taking in extra information from the developer as required during the "compile" (again without requiring a GUI).
> 
> You could have special directives for source to source transformations such as:
> 
> @extractMethodBegin
> … swift code ...
> @extractMethodEnd
> 
> @indentBegin
> … swift code ...
> @indentEnd
> 
> @commitCommentFragmentBegin
> … swift code ...
> @commitCommentFragmentEnd
> 
> etc…
> 
> Why encourage reinventing the wheel by pushing source to source transformations to tools of varying quality and completeness?
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151229/21a3a272/attachment.html>


More information about the swift-evolution mailing list