Very great article, and I like what you said about Julia and staticality. Not only does Julia carry a host of benefits over Python otherwise, but the language itself is incredibly dynamic. If you want to work with static types for example, you can make a struct,
struct examp
data
end
and then use dispatch to dispatch it to methods.
method(input::examp) = function(examp)
(That way your functional methods and macros can handle all sorts of different types)
In contrast, you can also have a dynamic, mutable type
mutable struct examp
data
end
Using these two things along with dispatch typing, you can actually duck-type in Julia just like you would in Python using a function.
function examp(data)
childmethod() = data += 5
() -> (data;childmethod)end
And we can use that as if it’s duck typing in a statically typed language:
typ = examp(5)
The type holds our data, like a class:
println(typ.data)
5
And also our methods.
typ.childmethod()
println(typ.data)
10
This kind of language mutability is unparralelled, and that is on top of other features like syntactical expressions.
And I love these comments of people trying to argue Python’s speed. The advantage to Julia over Python is that I can write my code once in Julia, test it once in Julia, and never have to worry about moving it over to C. I’m not sure what their point is either, the tests have been done — yes Julia is substantially faster than Python, and depending on the circumstances can even outpace C. Keep in mind that going faster than C isn’t something that happens in every situation, but there are particular things that Julia is better at than even C is (because of pre-compiling, maybe if you want to learn more you could research into Julia’s JIT/JBT compiler.) The speed tests between JL, C, and Python are in public domain, and I don’t think that anyone who is simply listing the great things about a language he likes (that are proven to be true) needs to cite or recreate them. That’s like saying I have to cite the difference between an elephant and a mouse dimension and weight-wise when writing an article about why elephants are afraid of mice.
Python on the other-hand is an interpreted scripting language that is deciphered using the Python.h header. So in other words, Python has very close integration with C which is precisely why it is used for machine-learning. Most Python packages you use are written in C, but let’s think about the last time you wrote C…. Last time I wrote some C it took me two hours to make a string parser to seperate data held in a table text file. It’s important to remember that just because a Python package is written in C doesn’t mean that nobody had to write the C, as Cython is definitely not a reliable method in any way, shape, or form to write C code.
So with that in mind, go write a few machine-learning models in C and let me know how long that takes. I’ll stick to Julia where I can write the models in a 16th of the time with similar performance. A key advantage of Julia is not only its compilation speed, but also the speed at which you can write it.