really fast ? • If so, then why … • Can this be retro-fitted to existing languages? How Julia gains from the interaction with Python. Can Python do the same (in reverse)?
to have a scripting language that you can work with interactively: • ease of development, prototyping • data exploration • dynamic typing, visualisation Can use from Python, Matlab/Octave, R, Lisp … Critical parts of the coding need to be written in a lower language such as C, Fortran or Java. This approach has its drawbacks: • the hard parts are where we need an easier language. • it forces vectorization where it may be inappropriate. • it creates a division between the analyst and programmer.
compiling down to native machine code. This uses the LLVM compiler technology and Julia is not alone: • Google V8 • Clang • Swift • LuaJIT Some Python developers are trying to do much the same with: • Numba • Parakeet • Pyston Is this going to work?
is a good optimizing compiler but it needs to be given sufficient information to do its job well. • Type inference • Type stability • Delegation O-O paradigm • Multiple dispatch • Staged code generation
libraries • ccall((:foo, “lib”), RetType, (xType, yType, …), x, y, …) • If “lib” is omitted default is libjulia • e.g. call((:time, “libc”), Int32, () ); Julia calls other languages via various modules • Python : PyCall • C++ : Cxx • R : Rcall, RIF • Java : JavaCall The most utilised, at present, is PyCall
call Python functions directly from Julia. Used in a variety of Julia modules (including) : • PyPlot • SymPy • Pandas • PyLCM IJulia and Jupyter was result of Steven Johnson spending a week at Berkeley with Fernando Perez.
More experimental than the Julia to Python interface Install using a python setup.py routine Needs PyCall to be installed on the Julia side Use from python as • from julia import Julia • jl = Julia() • print “Bessel fn of 2nd kind Y 0 (1.5) is “, jl.bessely0(1.5) Limitations: • Not all valid Julia identifiers are valid Python identifiers. => Only ASCII names can be used. • Julia implements ‘bang’ functions such as push!() => Conventionally these are passed as jl.push_b()
to Julia base functions. Implement non-vectorised critical code. Use specialist Julia modules. • Bayesian, MCMC and machine learning • Signal processing, optimisation methods Interface to C-functions and object libraries. Run highly parallelised tasks.
speeding up Python using LLVM-style techniques will not work Python has established a niche domain and probably is better to remain there From Julia viewpoint: Python has already proved to be a very valuable companion. As Julia matures Python may come to be reliant on her in certain areas, as it is now on C.