News for hackers. Stuff that matters.
Re:Swift: Madness of Generic Integer by __m on Tuesday March 03, 2015 @06:35PM (#9141565)
how would the compiler know what numbers to expect at runtime?
Re:Swift: Madness of Generic Integer by pcwalton on Tuesday March 03, 2015 @06:38PM (#9141577)
Either by specializing the generic code to the specific types at compile time, or by using dynamic dispatch. (Note that this is the same tradeoff you get if you write the non-generic code by hand, so generics don't create a tradeoff where there wasn't one already.)