4 ms·
First and foremost you should have a general understanding of type inference. You also have to understand the difference between a function and a method (in Jul
by davnn 6y ago
First and foremost you should have a general understanding of type inference. You also have to understand the difference between a function and a method (in Julia's terms), see:
Functions:
https://docs.julialang.org/en/v1/manual/functions/ https://docs.julialang.org/en/v1/manual/functions/
Methods: https://docs.julialang.org/en/v1/manual/methods/ https://docs.julialang.org/en/v1/manual/methods/
Once that's understood, multiple dispatch is simply using all of a function's arguments inferred types to choose which method should be invoked.
- StefanKarpinski 6y agoMaybe you’re using the term loosely, but one definitely shouldn’t have to understand type inference to write working Julia programs. Unlike static type systems like Haskel or ML where inference is part of the spec, inference in Julia is just an optimization and doesn’t affect behavior at all.
- davnn 6y agoRelating to other programming languages, it was the first term that came to mind. You have to know the type before you can specialize a function, don't you? I think it's a good mental model to constantly keep the types in mind, but I have made the experience that people working exclusively in dynamically typed languages, i.e. the majority of data scientists, don't share that mental model.