Taking Full Advantage Of Parametric Polymorphism With Julia
Parametric polymorphism is Julia’s SUPER POWER! Here is why.
julia
In a vast space of incredibly similar multi-paradigm programming languages, the Julia programming language manages to stand out in a few key ways. The language resides in a novel paradigm centered around multiple dispatch, and offers a host of powerful possibilities as a result. To compound this, Julia features a robust type system that is perfectly tuned to work inside of this paradigm. With multiple dispatch as a central premise, Julia allows for the creation of far more software with far less code.
Using multiple dispatch as a paradigm allows us to create far more dynamic code — from type structures to methods — which is able to be used more generically. When our constructors act as multiple types at runtime and our functions can be written as generically as possible, we end up creating a lot less constructors and programming a lot less functions and methods to produce more types and more function calls for those types. Parameters compound this with the ability to further distinguish different types that are made via the same constructors using multiple dispatch.
In this context, generic refers to a routine’s (function’s) ability to work with multiple…