Python is time to make room. About the prospects of Julia

Good morning, Habr!

The clip of our Python literature is constantly replenished with books of various levels. However, today we would like to introduce this article today, the author of which considers Julia to be a viable and promising alternative to Python. Read, follow the links and do not forget to vote.



If Julia still seems mysterious to you, don't worry. Photo by Julia Caesar on Unsplash



Do not misunderstand me. The popularity of Python is still guaranteed by the unshakable support of the community, which includes specialists in computer science, data science and artificial intelligence.

However, if you had a chance to sit at a dinner in the company of these people, you would see how outraged they were by Python's flaws. Not only is this language very slow, it also requires extensive testing, and still gives runtime errors, despite prior testing. This is enough to make Python a depressing impression.

That is why more and more programmers are switching to other languages, among which Julia, Go deserve special mention.and Rust. Julia is perfect for mathematical and technical problems, Go for modular tasks, and Rust is indispensable in system programming.

Since data science and artificial intelligence have to deal with a host of mathematical problems, Julia is a godsend for them. Even with a very critical examination, it turns out that Julia has such advantages that Python can not oppose.

Zen versus Julia's gluttony.

Inventing a new programming language, its authors strive to preserve the strengths and eliminate the shortcomings of older languages.

It was in this vein that Guido van Rossum acted in the late 1980s, creating Python: he sought to improve ABC. The last one was too perfectfor a programming language - and because of such rigidity, it turned out that it is easy to learn, but difficult to use in real projects.

Python, by contrast, is very pragmatic. This is evident from the Zen code of Python , reflecting the intentions of its creators:

Beautiful is better than the ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than confusing.
Deployed is better than nested.
Sparse is better than dense.
Readability matters.
Special cases are not so special as to break the rules.
At the same time, practicality is more important than impeccability.
[...]


Python has retained many of the benefits of ABC: for example, readability, simplicity, and clarity for beginners. But Python is much more reliable than ABC, and much better applicable in real life.

In a similar sense, the creators of Julia wanted to keep all the best from other languages ​​and get rid of all the bad. But Julia’s ambitions are far from limited to this: the goal is not to replace any one language, but to surpass all languages.

Here's what the creators of Julia say about this :

: . . C Ruby. Lisp, , Matlab. , Python, R, Perl, , Matlab, , shell. , , . , .


Julia seeks to combine all the advantages of existing languages, but not to compromise, which would require taking these languages ​​and their shortcomings. Moreover, although Julia is a young language, he has already achieved many of the goals set by its creators.

What Julia developers like The Julia

variety

can be used for anything from simple machine learning applications to colossal supercomputer simulations. Python is also capable of this to some extent, but Python has somehow adapted to these tasks.
On the contrary, Julia was created just for such work. From the very beginning.

Speed

The creators of Julia wanted to make a language not inferior in speed to C - but the creation they got turned out to work even faster. Even though it has become easier to speed up Python in recent years, its performance is still very far from Julia.

In 2017, Julia even entered the Petaflop Club , a small club of languages ​​that, with peak performance, can run at speeds above one petaflop per second. In addition to Julia, this club now includes only C, C ++ and Fortran.

The

Python community , which is over 30 years old, has a colossal and very reliable community. There is hardly such a question on Python, the answer to which is not found in one search query on Google.

On the contrary, the Julia community is very tiny. Yes, this means that you have to dig a lot more actively to find the answer, but with such searches you can go out to the same people again and again. And so invaluable professional programmer relationships are tied.

Code Conversion

To write code in Julia, you do not even need to know a single command in this language. Not only can you use Python and C code inside Julia, you can even use Julia code inside Python !

Needless to say, in this situation it is not difficult to patch the weak points of your Python code on Julia. Or to maintain productivity while you only get acquainted with Julia.

Libraries



Libraries have been and remain Python's strengths. PhotoSusan Yin on Unsplash

This is one of Python's most important virtues - it has tons of well-supported libraries. Julia does not have many libraries, and users complain that their libraries are (so far) not well supported.

But, adjusted for the fact that Julia is a very young language with a limited set of resources, the number of existing libraries is very impressive. In addition to the fact that Julia is enriched with new libraries, we note that the language can dock with libraries for C and Fortran, for example, for processing graphics.

Dynamic and static types

Python is 100% dynamic typing. This means that the program at runtime decides, for example, whether the given variable is an integer or a floating-point number.

Despite the fact that this practice is extremely convenient for beginners, all sorts of bugs penetrate the program because of it. As a result, Python code needs to be tested in all possible scenarios, and this is a pretty dumb task, time-consuming.

As the creators of Julia also sought to make their language easy to learn, Julia fully supports dynamic typing. But, unlike Python, Julia can also introduce static types - in the form in which they are present, for example, in C or Fortran.
This can save you a ton of time. Now, instead of looking for excuses for the fact that the code is not tested, you can simply specify the type wherever appropriate.

Data: we invest in the language while it is small



Number of questions marked Julia (left) and Python (right) on StackOverflow.

Despite the fact that all of the above sounds very optimistic, it must be borne in mind that Julia is still just a baby compared to Python.

There is a good indicator: the number of questions on StackOverflow: Python is currently mentioned about twenty times more often than Julia!

This does not at all indicate Julia’s unpopularity - rather, programmers just need time to get used to the new language.

Judge for yourself - would you yourself write all the code in a completely new language? No, you'd rather postpone the new language until you can try it in some fresh project. Because of this, there is a delay between the output of the language and its getting into widespread practice; this happens with all programming languages.

But, if you master Julia now, and it’s easy, considering how much language conversion is supported in Julia, this will be your investment in the future. As more and more people move to Julia, you will gain the necessary experience and be able to answer their questions. In addition, your code will turn out to be quite durable.

Bottom line: Practice Julia, and let it be your hobby

Forty years ago, artificial intelligence was nothing more than a niche phenomenon. Neither investors nor industry believed in it, and many AI technologies seemed clumsy and inconvenient to use. But those who studied AI even then became giants today - today their salaries are about the same as those of top athletes.

Similarly, Julia remains very niche right now. But when he grows up, those who switched to him in advance will be the biggest winners.

I do not promise that in ten years you will certainly be raking money with a shovel if you now learn Julia. But your chances of such a development of events will increase.

Think about it: today, most programmers use the Python language in their resumes. A few more years will pass, and we will see even more piton programmers on the labor market. But, if the growth in demand for Python in the enterprise slows down, then the prospects of Python-programmers will begin to deteriorate. At first, slowly, but inevitably.

On the other hand, you can truly stand out if you specify Julia in your CV. Since, we will be honest, but how do you differ from the whole army of pitoners with whom you have to compete? Almost nothing. But programmers with knowledge of Julia will remain relatively rare specialists, even in the future for the next three years.

Possessing Julia skills, you do not just demonstrate that your interests are not limited to the requirements “for work”. You also show that you are willing to learn and have a wider idea of ​​what it means to be a programmer. In other words, it’s worth dealing with you.
You - and other Julia experts - may turn into stars in the future, and you know that. Or, as one of the creators of Julia in 2012 said:

, , . , . , 1.0 . , , Julia. 90% , , . , – , – , .

All Articles