News for hackers. Stuff that matters.
Re:Why Julia by alanfranz on Monday February 25, 2019 @03:56AM (#19244113)
> How do you do that in a statically typed language?

You can do that only if the interface for both types is identical or compatible. They should offer at least a common subset of the same operations. Hence, "generics" is the answer to your question.

I understand your feeling. But my impression is that this kind of "black magic" isn't always the best. With generics and static typing, if it compiles, you'll know it will work. With "type inference" you need to test it at runtime. It may compile with near-native performance, or it may not. And maybe a small change in your source code will turn near-native performance to dismal performance.

There are no comments on this comment yet.