> On Aug 3, 2017, at 8:20 PM, Karl Wagner via swift-evolution > <swift-evolution@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
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution