<div dir="ltr">Here are a few thoughts:<div><ul><li>-swift=4<br></li><li>-swift-version=4<br></li><li>-language-version=4</li><li>a top-of-file "shebang"-style comment indicating the version, something like <font face="monospace, monospace">//#swift(4)</font>, mirroring the "#if swift" syntax</li></ul></div><div><div class="gmail_extra">
<br><div class="gmail_quote">On Fri, Jul 29, 2016 at 5:27 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class="gmail-"><blockquote type="cite"><div>On Jul 29, 2016, at 5:20 PM, Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><div dir="ltr">Chris writes:<div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">- <b>Source stability features: </b>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.</blockquote></div><div><br></div><div><br clear="all"><div><div><div dir="ltr"><div>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.</div><div><br></div><div>Are any obvious areas that will need refactoring to make this feasible? (Perhaps they could be turned into StarterBugs.)</div></div></div></div></div></div></div></blockquote><div><br></div></span><div>I think this would be a great thing to do. We need a few things:</div><div><br></div><div>- The actual compiler flag. It is worth bikeshedding how it is spelled. “-std=“ is good inspiration, but clearly the wrong specific name.</div><div><br></div><div>- 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.</div><div><br></div><div>- 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.</div><span class="gmail-"><div><br></div><blockquote type="cite"><div><div dir="ltr"><div><div><div><div dir="ltr"><div>How many versions back would the compiler be expected to support? Should the Swift 5 compiler still support Swift 3 code?</div></div></div></div></div></div></div></blockquote></span></div><br><div>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.</div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div><div>-Chris</div></font></span></div></blockquote></div><br></div></div></div>