[swift-evolution] Variadic generics discussion
laurent.mihalkovic at gmail.com
Tue May 31 16:21:01 CDT 2016
> On May 31, 2016, at 9:49 PM, Chris Lattner <clattner at apple.com> wrote:
>> On May 31, 2016, at 12:17 PM, L Mihalkovic via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> well there is no macro system, and for the moment a clear statement from chris that this is not on the table in the short term. the code in the example looked like run-of-the-mill swift, except for the “…". so that leaves us with swift looking code that would be executed by the compiler, but with nothing particular to tell which parts to and which not. just a thought.
> Lets be clear though: variadic generics are not in scope for Swift 3 either.
> I definitely don’t speak for the rest of the core team, nor have I discussed it with them… but IMO, this whole feature seems like a better fit for a
> macro system
> than it does to complicate the generics system. Unlike C++’s template system, our generics system inherently has runtime / dynamic dispatch properties, and I don’t think that shoehorning variadics into it is going to work out well.
just for my education and purely as a thought experiment: couldn’t a purely runtime system based on some assistance from the compiler via a couple of synthesized ‘magic’ variables inside the scope of a function provide access to the types and the values as tuples? that would only give variadic generic functions, but that is something in itself. I would never claim the idea, but it looks close enough to what D is doing.
>>> On May 31, 2016, at 7:59 PM, Austin Zheng <austinzheng at gmail.com <mailto:austinzheng at gmail.com>> wrote:
>>> How so? I'm interested in anything that can get us away from having to generating code at compile-time.
>>> On Tue, May 31, 2016 at 10:04 AM, L. Mihalkovic <laurent.mihalkovic at gmail.com <mailto:laurent.mihalkovic at gmail.com>> wrote:
>>> What's interesting about the code in the manifesto is that it looks very much like "..." is a runtime construct, as opposed to trying the get the compiler to do the heavy lifting.
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution