Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Вячеслав Безбородов. Julia vs. Python

Вячеслав Безбородов. Julia vs. Python

Я расскажу об особенностях использования языка Julia и языка Python для решения вычислительных задач большой размерности, с примерами кода и комментариями.

Python Community Chelyabinsk

October 21, 2017

More Decks by Python Community Chelyabinsk

Other Decks in Research


  1. View Slide

  2. Julia vs. Python
    Doing your math

    View Slide

  3. What is Julia?

    View Slide

  4. A language for technical computing
    Julia features
    ● 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)
    History remark
    Julia was first appeared in 2012. It’s a young language with quite small, but quickly
    growing community.
    It is a flexible dynamic
    language, appropriate for
    scientific and numerical
    computing, with performance
    comparable to traditional
    statically-typed languages.

    View Slide

  5. View Slide

  6. Travis CI

    View Slide

  7. REPL

    View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. Julia is not Python

    View Slide

  12. 1-based indexing
    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

    View Slide

  13. Calculations

    View Slide

  14. View Slide

  15. View Slide

  16. View Slide

  17. View Slide

  18. Going parallel

    View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. View Slide

  27. Networking

    View Slide

  28. Nothing is impossible. Let’s write a server!

    View Slide

  29. View Slide

  30. View Slide

  31. Further reading
    ● https://julialang.org/
    ● http://www.laketide.com/julia-vs-r-vs-python/
    ● https://www.quora.com/What-are-the-disadvantages-of-Julia-compared-to-Python
    ● https://medium.com/@Jernfrost/python-vs-julia-observations-e61ee667fa95
    ● https://modelingguru.nasa.gov/docs/DOC-2625

    View Slide

    +7 919 407 10 66
    [email protected]
    [email protected]

    View Slide