<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 22, 2017, at 7:09 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">On Fri, Dec 22, 2017 at 6:12 PM, Chris Lattner<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:clattner@nondot.org" target="_blank" class="">clattner@nondot.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Dec 22, 2017, at 1:03 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="m_-2751741850073723399Apple-interchange-newline"><div class=""><div class="m_-2751741850073723399Singleton"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><span class="m_-2751741850073723399gmail-"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class="">In short, respectfully request that you at least add this approach to the "alternatives considered” section.</div></div></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""></span></div><div class="">So, does anyone have any strong objections to Chris’s proposal?</div><div class=""><br class=""></div><div class="">From an implementation standpoint, reworking the parser to parse @available(inlinable) and @available(fixedContents) or whatever would be straightforward. I would still like to punt the version range part of this to a future proposal, though.</div><div class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">I wish I had more time to compose a fully thought-out reply, but that's not going to happen in a little while because of outside constraints, so I'll spill a few thoughts here:</div></div></div></div></div></div></blockquote><div class=""><br class=""></div></span>No rush, no worries, enjoy the holiday!</div><div class=""><span class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="m_-2751741850073723399Singleton"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">I'm not a great fan of the @available(inlinable) notation.</div><div class=""><br class=""></div><div class="">For one, I have a hard time reasoning how Swift would behave when inlinability is tied to OS version. In this example, if the *app* (as opposed to the library) is compiled (as opposed to run) on iOS 16+, then the *library method* would potentially be emitted into the app, but if compiled on iOS 15 it wouldn't? Huh?</div></div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">No: availability information kicks in based on what you are *deploying* to, not what you’re compiling on.</div><div class=""><br class=""></div><div class="">I expect that this stuff will be extremely rarely used in practice, but here’s an example:</div><div class=""><br class=""></div><div class="">iOS15 declares this public:</div><div class=""><br class=""></div><div class="">public void foo() {</div><div class="">&nbsp; &nbsp;bar()</div><div class="">}</div><div class=""><br class=""></div><div class="">iOS16 wants to promote foo to inlinable, but knows that the inlined body doesn’t work with iOS15, because iOS15 needs the call to bar to happen (for whatever reason)</div><div class=""><br class=""></div><div class="">@available(inlinable: iOS16)</div><div class="">public void foo() {</div></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div class=""><div class="">// nothing needed on iOS16 or later.</div></div></blockquote><div class=""><div class="">}</div></div></div></blockquote><div class=""><br class=""></div><div class="">Deployment platform makes more sense, but I still can't envision a real use case. What sorts of `bar()` would hypothetically be necessary for iOS 15 but not 16? Why would a third-party library need to increase its inlining availability for an app based on deployment platform?</div></div></div></div></div></blockquote><div><br class=""></div><div>A better example would be if bar() was itself only available in iOS 16:</div><div><br class=""></div><div>@available(iOS 15)</div><div>@available(inlinable: iOS 16)</div><div>public func foo() {</div><div>&nbsp; bar()</div><div>}</div><div><br class=""></div><div>@available(iOS 16)</div><div>public func bar() { … }</div><div><br class=""></div><div>Suppose your app calls foo() and deploys to iOS 15. Then you cannot inline foo(), because bar() does not exist on iOS 15. (Presumably, foo() had a different implementation on iOS 15). But if you’re deploying to iOS 16, all is well, and you can inline foo(), which results in your app directly calling bar().</div><br class=""><blockquote type="cite" class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">I'm quite sure that the reason you inverted your "abiPublic" example is because of the same issue. Intuitively, you would want to mark something as "available" in version N and then maybe some special kind of "available" in version N+1 (which @available(inlinable) would be). But @available(linkerSymbol), as you spell it, suffers from a similar problem to that of @available(unavailable): it's _not_ a special kind of API availability, but rather indicates that something is less-than-available. That is, you would use it to indicate that something is available as ABI but not as API. In that sense, it extends the "mess" we have with @available(unavailable).</div></div></div></div></blockquote><br class=""></div><div>I don’t think it’s quite the same thing as @available(unavailable). An @available(abiPublic) symbol would still be declared to have internal visibility, so in this case the @available attribute makes it strictly more visible than it would be without. We’re not going to spell it as ‘@available(abiPublic) public’, which indeed would be confusing because the symbol is not actually public at the source level.</div><div><br class=""></div><div>Slava</div><br class=""></body></html>