AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
The Importance of Generics in the Compiler
With generics, we're able to vary the type of the input of a function or the output of a function. It's called type parameterization. So if we can do that, now we can have an infinite number of actual implementations of it because the type can change. The implications of this go beyond map, but fundamentally, now we're at a point where instead of using interface, raw interfaces, or, you know, the any type now,. Instead of doing reflection,now we can add compile time, prove that certain functions will work for some definition of work.