<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=""><div><blockquote type="cite" class=""><div class="">On Jul 31, 2017, at 12:16 PM, Tino Heth <<a href="mailto:2th@gmx.de" class="">2th@gmx.de</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=""><div class=""><br class=""><blockquote type="cite" class=""><div class=""><span 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; float: none; display: inline !important;" class="">OTOH, if the compiler can prove that a local array is never resized, why *shouldn't* it get all the benefits of a fixed-sized array without having to use a special syntax? Put another way, why shouldn't fixed-size be one of those optional attributes for arrays, like ownership will be for variables, that users can opt into for more performance but is otherwise automatically worked out by the compiler?</span></div></blockquote></div>I think it's a good idea in general, but I don't think I'd notice if this feature would exist, so just to save some work for the compiler (and Core), I'd prefer to first get the feature itself, and improve it later.<div class="">So from my high-level perspective, I think the order should be</div><div class="">0) Add support for value literals as generic parameters</div></div></div></blockquote><div><br class=""></div><div>Value literals would be limited to the ones accepted by ExpressibleBy*Literal, which would be very limiting for anything that isn't an Int or a Float. This might solve the specific case of fixed-size arrays, but otherwise would be nearly useless.</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="">1) Add Array<T, size: UInt></div><div class="">2) Add support for generic parameters that are evaluated at compile time</div><div class="">3) Make everything fast ;-)</div><div class="">n) Add useful additions like detecting arrays that aren't declared as fixed length, but could</div><div class=""><br class=""></div><div class="">I think the alternative to macros (don't care much how hygienic they are ;-) could be even more beneficial, but it's a topic that stands on its own (not sure wether this thread is more for fixed size arrays or metaprogramming… ;-)</div></div></div></blockquote></div><br class=""></body></html>