The Julia Programming Language
medium.com
medium.com
I think it is great to see that a port of the Fortran code in Julia is nearly as fast as the Fortran code itself. So you can take Julia and write concise Matlab-style code (vectorized everywhere) or write imperative code (loops everywhere) and be equally fast.
Note that the graphs in the post are biased. The Fortran version uses a different algorithm for the solver.
Edit: The Matlab code is highly obfuscated. That is not good for the sake of comparison.
https://github.com/precisesimulation/julia-matlab-fortran-fe...
so this :
for i = 1:size(a)[1]
a[i] = 2a[i] + 3b[i]
end
is faster than a = 2a .+ 3b
(although I haven't benchmarked it)Here's someone that did : http://aflyax.github.io/de_vectorization-runtime/
but in 0.5 there are speedups, apparently.
Here's a stack overflow discussion on it
http://stackoverflow.com/questions/27928502/julia-vectorized...
ulia> @time vect(x, y, a, b) 0.000038 seconds (29 allocations: 37.406 KB) 1×2 Array{Float64,2}:
julia> @time devect(x, y, a, b) 0.000006 seconds (10 allocations: 512 bytes) 1×2 Array{Float64,2}:
julia> @time vect(x, y, a, b) 0.002324 seconds (73 allocations: 3.075 MB) 416×2 Array{Float64,2}:
julia> @time devect(x, y, a, b) 0.000206 seconds (18 allocations: 23.359 KB) 416×2 Array{Float64,2}:
See here: https://github.com/JuliaLang/julia
OpenBLAS — fast, open, and maintained basic linear algebra subprograms (BLAS) library, based on Kazushige Goto's famous GotoBLAS.
LAPACK (>= 3.5) — library of linear algebra routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems.
MKL (optional) – OpenBLAS and LAPACK may be replaced by Intel's MKL libraryPython + NumPy has a large mindshare, and can be 10x from Fortran/Julia even if you use NumPy vectorization. And often loops are simpler or required anyway (dropping Python to 1000x slower).
Languages like Julia and Fortran also allows you to hit peak where you are limited by memory bandwidth, which is most of the time (not for DGEMM though...)
The mythical Sufficiently Smart Compiler, is, well, a myth.
That being said, Julia is really fun language to learn if you know Python and Matlab already. Although in the beginning, I kept on forgetting whether it is following Matlab-like syntax or Python-like syntax for certain features.
One of the biggest problems that I had with Julia (which is one of the main reason I stopped using it) was the flexibility of the . notation. I use this feature in Python and Matlab a lot and I had some serious trouble trying to make it work or finding examples on how to use it. Though I think this problem will be fixed as the community grows.
One of the biggest problems that I had with Julia (which is one of the main reason I stopped using it) was the flexibility of the . notation. I use this feature in Python and Matlab a lot and I had some serious trouble trying to make it work or finding examples on how to use it. Though I think this problem will be fixed as the community grows.
What are you referring to? Properties?
I'm using R regularly, and I couldn't care less for R-Studio. In our stat group, only 1 statistician out of 7 is using R-studio, while all of them are using R.
The IDE has very little to do with adoption.
In the end though, unless you want to reimplement methods, you can count on having R packages for any method you can think of.
Few statisticians though spend the time to evaluate different IDEs than what they where taught. I've "converted" many still using Rwin.
Recent JuliaCon talk allowing off the debugging features. https://m.youtube.com/watch?v=yDwUL3aRSRc
That said it costs too much and doesn't scale well to multimachine workloads. The language is also quite quirky by modern standards.
Matlab is in part a wonderful IDE that lets me run any segment of code and maintain variables. This is perhaps outside of the language, but I did see Julia's blog post about Juno and it looks useful.
Maybe the biggest concern is documentation for functions. Is it quick to look up any function? Is it quick to discover available functions relevant to a task?
No significant experience there. I would read http://docs.julialang.org/en/release-0.5/manual/strings/ and make sure that the data structures are adequate for your work. You can write C-like code and get C-like performance. Julia also makes it easy and efficient to pass data to and from C. Python/R/Matlab interop works nicely, but there's a cost.
> Maybe the biggest concern is documentation for functions. Is it quick to look up any function? Is it quick to discover available functions relevant to a task?
The docs are pretty terse:
http://docs.julialang.org/en/release-0.5/stdlib/strings/
Google is pretty good for discovery, although not as good as for widely-used languages. Many people ask on the julia-users Google group, and almost every well-written question gets answered. Typing ?function_name in the REPL returns the function docstring, similar to Python, and does a (very-limited) look-up.
I use Jupyter, and find the experience much better than in a REPL. I've tried Juno, and it's still too much of a WIP for me. YMMV.
Complete gibberish. Matlab (like Octave and the parts of Julia tested here) is made of Fortran parts. Were this an actual benchmark it would have spectacularly outperformed Matlab, Octave and Julia.