<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Chris has rules macros out-of-scope for 3.0. Who knows, maybe they'll be allowable in 4.0</div><div><br>On Jun 9, 2016, at 1:41 AM, Alexander Momchilov via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=us-ascii">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><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></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>