This comes from someone who used to despise the language, but it’s truly come a long way.
[1 2 3; 4 5 6; 7 8 9] ^ 2
I have to wait about 5 seconds for a response (on a first generation Core i7, SSD). On the other hand, running the following in a fresh Python interpreter is almost instantaneous: import numpy as np
np.linalg.matrix_power([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2)
Unfortunately, in most scenarios the actual execution speed (where Julia is far superior) is secondary. People just tend to run larger experiments over night; and as long as you can express your code in terms of numpy matrix operations, Python is fast enough.> Unfortunately, in most scenarios the actual execution speed (where Julia is far superior) is secondary. People just tend to run larger experiments over night;
I don't think there are only two scenarios, one requiring instant feedback and dependent on fast startup time, and the other where programs can be run overnight. There are infinite cases in-between. And crucially what about programs that take several days if not weeks (such as the biomechanical data analysis I do in my work)? Execution speed for me (and many others) is essential and doing this work in Python is a pain (I was using it for the same kind of problems before I switched to Julia).
Put that in a function and run it twice. The second time will be blazing fast since it's jitted. That's the workaround for REPL/Notebook usage. In my experience with Notebooks, I end up having to rerun the code all the time, so it will only be slow the first time around. And I've had my share of Python code that took 5 seconds or more to complete, every single time.
time julia -e '[1 2 3; 4 5 6; 7 8 9] ^ 2'
real 0m1.629s
And for Python/Numpy time python -c 'import numpy as np; print(np.linalg.matrix_power([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2))'
real 0m0.103s
Edit: Julia Version is 0.6.3, installed directly from the Fedora 28 repositories. time perl6 -e 'say [1, 2, 3; 4, 5, 6; 7, 8, 9] >>**>> 2'
[(1 4 9) (16 25 36) (49 64 81)]
real 0m0.170s
Note that the majority of that time is just loading Perl 6. time perl6 -e 'Nil'
real 0m0.156s
Perhaps someone could create a slang module for Julia in Perl 6, as that would be a fairly easy way to improve its speed.
(Assuming Julia is easy to parse and doesn't have many features that aren't already in Perl 6)I'm not sure that the Julia language itself is lacking in any general sense. It's just more geared toward scientific computing, but there's nothing about the language making it that hard to write general code. It's not R.
[1] https://www.tiobe.com/tiobe-index/
[2] https://spectrum.ieee.org/computing/software/the-2017-top-pr...
My apologies for the wording. I should have just said I wish it was used more in industry nowadays. And thanks for creating Julia btw! It's been a very enjoyable and productive language to program in.
Oh my god. This has bit me in the ass every time i did something with matrices in python. It seems like such a weird split.
In fact I am sure that advocates of Go, Rust et al are really comparing them to C++98 and would be very pleasantly surprised by C++14
I’m using cling, part of ROOT, for that https://root.cern.ch/cling
Thing is, no matter how much better C++ gets, preventing some groups to use it as "C compiled with C++ compiler" is fighting windmills.