Articles Hierarchy

Articles Home » RPI » what is Julia language?

what is Julia language?

see Wiki
well not a new thing anyway... 2009
see from 2017
but more from the RPI Forum
on some ?old? sites i see
sudo apt install julia would give you rev 1.0.3 ( i did not try here )
a documentation here
and download newest with help here.


but all that not say what it is for???
just a idea, a better MATLAB ? well that is easy, Julia is for free!


today i try on my RPI4B:
and try to follow
ejolsonI usually unpack the archive into
/usr/local/julia-1.6.2
and then make a symbolic link to
/usr/local/bin
using the command
$ cd /usr/local/bin
$ sudo ln -s /usr/local/julia-1.6.2/bin/* .

cd /usr/local/
sudo wget https://julialang-s3.julialang.org/bin/linux/armv7l/1.6/julia-1.6.2-linux-armv7l.tar.gz
( get 98MB with 10MB/s )
sudo tar zxvf julia-1.6.2-linux-armv7l.tar.gz
( here could delete the big zip file)
cd /usr/local/bin
sudo ln -s /usr/local/julia-1.6.2/bin/* .

exit & open new terminal

$julia

help should start with how to QUIT
julia> [ctrl][d]
$



setup working dir for files...

mkdir julia
cd julia


pi@RPI4:~/julia $ uname -a
Linux RPI4 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l GNU/Linux
pi@RPI4:~/julia $
pi@RPI4:~/julia $ julia
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.2 (2021-07-14)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia>

how about PKG? its seems needed for the following example code..

julia> import Pkg; Pkg.add("StaticArrays")
Updating registry at `~/.julia/registries/General`
Resolving package versions...
Installed StaticArrays ─ v1.2.12
Updating `~/.julia/environments/v1.6/Project.toml`
[90137ffa] + StaticArrays v1.2.12
Updating `~/.julia/environments/v1.6/Manifest.toml`
[90137ffa] + StaticArrays v1.2.12
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[9a3f8284] + Random
[9e88b42a] + Serialization
[2f01184e] + SparseArrays
[10745b16] + Statistics
Precompiling project...
1 dependency successfully precompiled in 28 seconds

julia>[ctrl][d]
$

how about code ( files... )
nano barnfast.jl
( paste from forum..post )
pi@RPI4:~/julia $ JULIA_NUM_THREADS=4 julia barnfast.jl # Julia 1.6.2
ERROR: LoadError: InexactError: UInt32(NaN)
but still bad luck


anyhow... ? how to see a plot..
$ julia
julia>using Pkg
julia>Pkg.add("Plots")
julia>Pkg.add("PyPlot")
# optional julia>Pkg.add("StatPlots")
# had ERROR julia>Pkg.add("PlotRecipes")
after 15 min downloading and compiling..
julia> [ctrl][d]
$ julia
julia> using Plots
julia> data = rand(10)
julia> f = plot(data)


so, little bit long way.. but i see something


i want to see some sinus curves... yes many ways to do it,
but as i am here already:

to learn more about plots