Julia¶
Julia is a high-level, high-performance, dynamic programming language. While it is a general-purpose language and can be used to write any application, many of its features are well suited for numerical analysis and computational science (wikipedia).
Example Code¶
Mandelbrot¶
(a)
z 0
50
z + a
end
return z
end
1.0
0.5
abs(mandelbrot(complex(x, y))) " ")
end
println()
end
Usage¶
Interactive¶
Julia comes with a full-featured interactive command-line REPL (read-eval-print loop) built into the julia executable. In addition to allowing quick and easy evaluation of Julia statements, it has a searchable history, tab-completion, many helpful keybindings, and dedicated help and shell modes. The REPL can be started by simply calling julia with no arguments or double-clicking on the executable. (Julia Documentation REPL)
string(1 + 2)
"3"
julia> rand(2, 2)
2×2 Array{Float64,2}:
0.8833 0.329197
0.719708 0.59114
Jupyterlab¶
there exists a julia launcher on the Maxwell JHUB to use Julia kernels in Jupyterlab
On the command line¶
[sternber@max-wgse001]~% module load maxwell julia
[sternber@max-wgse001]~% julia mandelbrot.jl
**
******
********
******
******** ** *
*** *****************
************************ ***
****************************
******************************
******************************
************************************
* **********************************
** ***** * **********************************
*********** ************************************
************** ************************************
***************************************************
*****************************************************
***********************************************************************
*****************************************************
***************************************************
************** ************************************
*********** ************************************
** ***** * **********************************
* **********************************
************************************
******************************
******************************
****************************
************************ ***
*** *****************
******** ** *
******
********
******
**