<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="">Le 9 juin 2016 à 01:41, Alexander Momchilov via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Preface: I know this is likely a large undertaking to implement, but I think it's worth it.<div class=""><br class=""></div><div class="">In addition to the typical compiler optimization of constant math expressions, some languages (such as D and C++) have support for running&nbsp;<a href="https://en.wikipedia.org/wiki/Compile_time_function_execution" class="">arbitrary functions at compile time</a>&nbsp;(with some constraints).</div><div class=""><br class=""></div><div class="">I see many advantages of this:</div><div class=""><ol class="MailOutline"><li class="">On iOS/OS X: it could precompute the UI and app initialization logic (wherever possible) to speed app load times</li></ol></div></div></div></blockquote><div><br class=""></div><div>I can’t see how it would speed up app launch time. You still all have to allocate and init all UI objects, especially as they are opaque objects and can’t be precomputed.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><ol class="MailOutline" start="2"><li class="">It can significantly speed up the initialization of applications with large static properties. E.g. large constant Dictionaries could be precomputed.</li><li class="">You could keep complex math expressions (including custom functions) in their unevaluated form, without the pressure to precompute them elsewhere and hardcode in the result.</li><li class="">Dynamic programming: expensive look-up tables could be precomputed. These wouldn't necessarily be large in size, but if their elements are especially expensive to compute, there would be a huge advantage to precomputing them.</li></ol><div class=""><br class=""></div></div><div class="">What do you guys think? Can you think of any other useful applications? Would it be worth the implementation effort?</div><div class=""><br class=""></div><div class=""><div class="">- Regards,<br class="">&nbsp; &nbsp; &nbsp; &nbsp; Alexander Momchilov</div></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>