<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 1:49 PM, Chris Lattner via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 12:05 PM, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 21, 2015 at 11:55 AM, Chris Lattner via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class="">…there probably has to be some way to unsafely “force a call to a non-pure function to be allowed in a pure one”, both because of type system limitations as well as interoperability with C and other languages. Even ignoring issues around errno, it would be sad for a pure function to not be able to call “sin(x)” just because it weren’t marked __attribute__((const)).</div></div></div></blockquote><div class=""><br class=""></div><div class="">Minor tangent, but should the same apply to @noescape? </div></div></div></div></div></blockquote><br class=""></div><div class="">Yes, it should. I believe you can currently use an unsafe cast to remove @noescape, and that the stdlib does it in a few places. Dmitri, do you know where?</div></div></div></blockquote><br class=""></div><div>The runtime does this using unsafeBitCast, but don't follow its example—I don't want to promise this will always be possible. There are representation optimizations we can do with @noescape closures that would be blocked if they always had to be bitcastable to refcounted escapable closures. I'd like to introduce a `Builtin.makeEscapable` operation specifically to go from @noescape to escapable, introducing a refcounting shim if necessary in the future.</div><div><br class=""></div><div>-Joe</div></body></html>