[swift-evolution] Variadic generics discussion

Matthew Johnson matthew at anandabits.com
Tue May 31 14:11:57 CDT 2016


> On May 31, 2016, at 1:11 PM, Austin Zheng via swift-evolution <swift-evolution at swift.org> wrote:
> 
> AFAICT compile-time code generation suffers from the C++ templates problem - my understanding is that if you don't have access to the definition of the template you can't specialize. A Swift (regular, non-variadic) generic function can be called with any conforming type without need for specialization through dynamic dispatch, with specialization still existing as an optimization. Having the same apply to variadic generics would be a significant advantage.

I believe there has been some discussion of packaging SIL (or something like that) with modules for at least some generic constructs to allow specialization across module boundaries.

> 
> On Tue, May 31, 2016 at 11:08 AM, David Sweeris <davesweeris at mac.com <mailto:davesweeris at mac.com>> wrote:
> Out of curiosity, why?
> 
> - Dave Sweeris
> 
>> On May 31, 2016, at 12:59 PM, Austin Zheng via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> 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>
>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

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


More information about the swift-evolution mailing list