4 ms·
Julia's multiple dispatch setup makes it very easy to generate fast generic algorithms. You can convert your mathematical paper on XYZ (adaptive stochastic diff
by ChrisRackauckas 8y ago
Julia's multiple dispatch setup makes it very easy to generate fast generic algorithms. You can convert your mathematical paper on XYZ (adaptive stochastic differential equation integrators) into a generic algorithm, and it will automatically work with complex numbers, arbitrary precision arithmetic, automatic differentiation, numbers with uncertainties, arrays on the GPU (i.e. no-copy and no-allocation GPU usage, almost like it was written for it!), array on the TPU, arrays distributed across a cluster, etc. Then to make it really fast what you need to do is not just improve the computation, but also the mathematics. Fortunately, making \ turn into a method optimized for triangular matrices is as simple as making the type Triangular, or making it use BLAS's banded matrix algorithms just requires making a BandedMatrix. Suddenly, if your algorithm is generic to types, you get a fully adaptive algorithm with specialized linear algebra on the GPU plus ..., and all you did was transfer your code from your paper to Julia. That's insanely powerful, and when you understand how it works it's a thing of beauty.
I write about it this in a lot more depth at my blog: http://www.stochasticlifestyle.com/category/programming/julia/ http://www.stochasticlifestyle.com/category/programming/juli... that page gets you to everything on Julia. One recent article which highlights Julia as a tool for code generation and how its type system leads to absurd feature composibility is http://www.stochasticlifestyle.com/why-numba-and-cython-are-not-substitutes-for-julia/ http://www.stochasticlifestyle.com/why-numba-and-cython-are-.... For me, Julia has opened up a whole research area of computing without arrays of floating point numbers but actually thinking about type encodings for feature composibility in order to perform complicated numerical mathematics efficiently without having to write much code.
- ArtWomb 8y ago"dynamic MATLAB" ;)
- ChrisRackauckas 8y agoHaha yeah. Julia is just a MATLAB where you utilize metaprogramming and other code generation tools to generate hardware independent LLVM IR from generic algorithms written on abstract types. :P