Re:Eight years of Go
by foldr on Friday November 10, 2017 @06:56PM
(#15674121)
I don't see any reason why the interface lookup couldn't be done at compile time in this instance.
[ Parent
| on HN ]
I don't think there is a technical reason. It's probably not something they'll do for a while because it probably requires some significant reorganization of the compiler and making a passably fast implementation is probably quite hard (the Go community places a premium on fast compiler times, rightly or wrongly). Also they seem to value predictable optimizations. Not sure how keen they would be to add an optimization that works until a seemingly inoccuous code change prevents the compiler from guaranteeing that all elements in the slice have the same concrete type, making performance (probably) significantly worse.
Again, I don't necessarily agree with the Go team; I'm just guessing the are some of the concerns they're weighing.