Julia used Multiple Dispatch! It's Super Effective!

submited by
Style Pass
2021-07-21 01:30:02

These days, I find myself evangelizing for Julia quite a bit. It’s a good language, especially for scientific computing, but I believe its focus on performance also makes it a good general language as well. At some level, programmers who know multiple languages have an abstract understanding of the constructs used within various languages: I/O, looping, branching, etc. And there’s an understanding that if you needed to write some computation, given enough time, you could probably write it in any language I gave you.

That being said, there are a number of “nice to have” features that greatly improve the programming experience. For instance: generics, polymorphic structures, dynamic typing, multiprocessing, libraries, etc. These aren’t necessarily deal breakers, but they can greatly increase the ease at which code is written, reducing unnecessary complexity, and improving collaboration.

Often times, while extolling the virtues of Julia, I’ll casually one of these mention one of those “nice to have” features: multiple dispatch. Usually met with a “what’s that?” and the inevitable “well when would you use that?”. Then I’ll scramble to string together an explanation, trying not to dive too deeply into abstract PL concepts. I never had a great example, until now.

Leave a Comment