[swift-dev] [swift-evolution] [Swift 4] Organizing source stability

Chris Lattner clattner at apple.com
Fri Jul 29 19:27:37 CDT 2016


> On Jul 29, 2016, at 5:20 PM, Jacob Bandes-Storch via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Chris writes:
> - Source stability features: These should be relatively small, but important.  For example, we need a “-std=swift3” sort of compiler flag.  We may also add a way to conditionally enable larger efforts that are under development but not yet stable - in order to make it easier to experiment with them.
> 
> 
> I am curious whether the team has thoughts on how to organize the compiler codebase in such a way that new features can be added, and possibly source-breaking changes made, while still keeping the old functionality around.
> 
> Are any obvious areas that will need refactoring to make this feasible? (Perhaps they could be turned into StarterBugs.)

I think this would be a great thing to do.  We need a few things:

- The actual compiler flag.  It is worth bikeshedding how it is spelled. “-std=“ is good inspiration, but clearly the wrong specific name.

- The implementation should be straight forward: the flag should get plumbed through to a field in swift::LangOptions.  Code that diverges can then check it.

- Handling divergence in the standard library is another big issue.  We have some ideas here, but it depends on having the compiler work done anyway to hook into.

> How many versions back would the compiler be expected to support? Should the Swift 5 compiler still support Swift 3 code?

To be determined.  Swift 4 should definitely support Swift 3, but Swift 5 perhaps not.  We can decide that when Swift 4 is winding down.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160729/ec88b581/attachment.html>


More information about the swift-dev mailing list