Я расскажу об особенностях использования языка Julia и языка Python для решения вычислительных задач большой размерности, с примерами кода и комментариями.
Julia vs. Python
Doing your math
What is Julia?
A language for technical computing
● Multiple dispatch
● Dynamic type system
● Call Python functions
● Call C functions directly (no wrappers or special APIs needed)
● Designed for parallelism and distributed computation
● Efficient support for Unicode, including but not limited to UTF-8
● Free and open source (MIT licensed)
Julia was first appeared in 2012. It’s a young language with quite small, but quickly
It is a flexible dynamic
language, appropriate for
scientific and numerical
computing, with performance
comparable to traditional
Julia is not Python
In Julia, indexing of arrays, strings, etc. is 1-based not 0-based.
Julia does not support negative indexes.
In particular, the last element of a list or array is indexed with end in Julia, not -1 as in Python.
Indentation level is not significant as it is in Python.
Julia's for, if, while, etc. blocks are terminated by the end keyword.
Julia arrays are column major (Fortran ordered) whereas NumPy arrays are row major
(C-ordered) by default
To get optimal performance when looping over arrays, the order of the loops should be reversed in Julia relative to NumPy.
Julia requires end to end a block.
Unlike Python, Julia has no pass keyword.
In Julia % is the remainder operator, whereas in Python it is the modulus.
Noteworthy differences from Python
Nothing is impossible. Let’s write a server!