2 ms·
Swift does this. A generic function compiled to a single actual function, which accepts metadata about the types passed in which allow it to do the things it ne
by mikeash 8y ago
Swift does this. A generic function compiled to a single actual function, which accepts metadata about the types passed in which allow it to do the things it needs. The optimizer may, of it decides it’s worthwhile, generate specialized versions of the function, but it’s never necessary.
- jasonwatkinspdx 8y agoI'm guessing the final golang solution will be like this, but with both runtime/boxed and static/typeswitch implementations generated by default, and some heuristic specializations between composing them.