by codeflo · 4y ago · 0 comments
In most languages, a function taking a float and a function taking an int end up producing different compiler output (because they need to use different CPU registers). More to the point, this extends to generic/template functions with signatures like “void foo<T>(T arg)”, which then need to be monomorphized, that is, copied for each instantiation.
Languages with type erasure simply drop the type argument instead of instantiating it.