Instalacja

sudo snap install julia # version 1.0.4

or

sudo apt install julia # version 1.4.1+dfsg-1

uruchamianie bash repl dockerdocker: Julia GoogleCollab ISTE NITH : Julia_on_the_GPU/mandlebrot/ bash W terminalu wpisujemy julia

Przykładowy wynik: _ _ _ _(_)_ | Documentation: https://docs.julialang.org (_) | (_) (_) | _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 1.4.1 _/ |\__'_|_|_|\__'_| | Ubuntu ⛬ julia/1.4.1+dfsg-1 |__/ |

lub z argumentami:julia lang manual: getting-started

julia script.jl arg1 arg2...

Kończenie programu:stackoverflow question: how-to-alias-quit-to-quit Ctrl-d

REPL Po uruchomieniu julii w terminalu wpisujemy

include("hello_world.jl")

inaczej:stackoverflow questionrunning-julia-jl-files

julia> include("path/to/script-name.jl")

tryby REPL ma 5 trybów wprowadzania ( ang. prompt modes )docs julialang : stdlib REPL Julian mode( domyślny) help shell search reverse search

katalogi

Aktualny katalog roboczy: w REPL wpisujemy:stackoverflow question : setting-working-directory-julia-versus-r pwd()

przykładowy wynik :

"/home/a"

Katalog domowy :

homedir() "

moduły

GUI Makie : Visualizations and plotting in Julia, docs and git repo

CUDA isinstalled(pkg::String) = any(x -> x.name == pkg && x.is_direct_dep, values(Pkg.dependencies())) pk = ["CUDA"] using Pkg; for p in pk; isinstalled(p) || Pkg.add(p); end Pkg.test("CUDA") Pkg

Pkg zawiera własny REPL.docs of julialang : Pkg getting-Started

Otwórz Pkg REPL, naciskając ] w Julia REPL. Aby wrócić do Julia REPL, naciśnij klawisz Backspace lub ^ C.

GR

Dodawanie modułu w trybie Julia REPL:

Pkg.add("GR")

lub w trybie Pkg REPL-mode:

add GR

plots

" from https://juliabyexample.helpmanual.io/"

"https://discourse.julialang.org/t/how-to-use-pkg-dependencies-instead-of-pkg-installed/36416/13" isinstalled(pkg::String) = any(x -> x.name == pkg && x.is_direct_dep, values(Pkg.dependencies()))

pk = ["Plots"] using Pkg; for p in pk; isinstalled(p) || Pkg.add(p); end

using Plots

" pwd() " cd("Dokumenty/julia/")

# plot some data Plots.plot([cumsum(rand(500) .- 0.5), cumsum(rand(500) .- 0.5)])

# save the current figure in Plots.savefig("plots.svg") # .eps, .pdf, & .png are also supported # we used svg here because it respects the width and height specified above RootsAndPoles Pakiet RootsAndPoles jest na juliahub

Instalacja using Pkg

PKG.add("RootsAndPoles");

skróty klawiaturowe Opis ( ang. Key bindings)docs.julialang.org: Key-bindings

Program control ^D Exit (when buffer is empty) ^C Interrupt or cancel ^L Clear console screen Return/Enter, ^J New line, executing if it is complete meta-Return/Enter Insert new line without executing it ? or ; Enter help or shell mode (when at start of a line) ^R, ^S Incremental history search

Gdzie Meta oznacza Alt

Zobacz również Introduction to Computational Thinking Math from computation, math with computation by Alan Edelman, David P. Sanders & Charles E. Leiserson Programowanie w systemie UNIX: Jupyter Project

Żródła