[swift-evolution] [Planning][Request] "constexpr" for Swift 5

Daryle Walker darylew at mac.com
Sun Aug 6 22:59:25 CDT 2017

> On Aug 3, 2017, at 8:20 PM, Karl Wagner via swift-evolution <swift-evolution at swift.org> wrote:
>>> The root cause, of course, is that the VLAs require new stack allocations each time, and the stack is only deallocated as one lump when the frame ends.
>> That is true of alloca(), but not of VLAs.  VLAs are freed when they go out of scope.
> Learned something today.
> Anyway, if the goal is stack allocation, I would prefer that we explored other ways to achieve it before jumping to a new array-type. I’m not really a fan of a future where [3; Double] is one type and (Double, Double, Double) is something else, and Array<Double> is yet another thing.

Just about every system programming language has all three of these, since you can’t really stop these “similar” types from co-existing. The third type uses remote storage, while the first two are scoped storage. A heterogenous product type template has to include homogenous product types as a subset. And instruction generators can produce different code between tuples and arrays; are you willing to forfeit one set of optimizations?

Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170806/ddc38597/attachment.html>

More information about the swift-evolution mailing list