LinuxCommandLibrary

julia

TLDR

Start the Julia REPL

$ julia
copy
Run a Julia script
$ julia [script.jl]
copy
Run with multiple threads
$ julia --threads [4] [script.jl]
copy
Evaluate an expression
$ julia -e '[println("Hello")]'
copy
Run in quiet mode (no banner)
$ julia -q
copy
Start with a specific project
$ julia --project=[path/to/project]
copy
Install a package (from REPL)
$ julia -e 'using Pkg; Pkg.add("[PackageName]")'
copy
Precompile packages
$ julia -e 'using Pkg; Pkg.precompile()'
copy

SYNOPSIS

julia [options] [script.jl] [args ...]

DESCRIPTION

Julia is a high-level, high-performance programming language for technical computing. It combines the ease of dynamic languages like Python with the speed of compiled languages like C, achieved through just-in-time (JIT) compilation via LLVM.
The REPL (Read-Eval-Print Loop) provides an interactive environment with tab completion, help system (type ?), shell mode (type ;), and package mode (type ]). The package manager Pkg handles dependencies through Project.toml and Manifest.toml files.
Julia excels at numerical and scientific computing, offering native support for multi-dimensional arrays, complex numbers, and mathematical operations. Parallel computing is built-in through threads, distributed computing, and GPU support.
The type system enables both high performance (through type inference) and flexibility (multiple dispatch allows functions to behave differently based on argument types). This makes Julia suitable for both rapid prototyping and production deployment.
Package environments isolate dependencies per project. The --project flag activates a specific environment. Packages are installed from the General registry or Git repositories.

PARAMETERS

-e expr

Evaluate expression.
-E expr
Evaluate and display result.
-p, --procs n
Start n worker processes.
-t, --threads n
Enable n threads (or "auto").
--project path
Set project/environment directory.
-q, --quiet
Suppress startup banner.
-i
Interactive mode after script.
-L, --load file
Load file at startup.
-J, --sysimage file
Use custom system image.
--startup-file yes|no
Load ~/.julia/config/startup.jl.
--history-file yes|no
Load/save command history.
-O, --optimize level
Optimization level (0-3).
--compile yes|no|all|min
Compilation mode.
--code-coverage none|user|all
Enable code coverage.
--track-allocation none|user|all
Track memory allocations.
--depwarn yes|no|error
Deprecation warnings.
--help
Display help.
--version
Display version.

CAVEATS

First run is slow due to JIT compilation (time-to-first-plot problem). Package precompilation takes time after updates. Memory usage can be higher than Python for simple tasks. Some Python libraries lack Julia equivalents. Thread-safety requires attention when parallelizing.

HISTORY

Julia was created by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman at MIT, with development starting in 2009 and public release in 2012. Version 1.0 was released in August 2018, marking language stability. Julia has gained significant adoption in scientific computing, data science, and machine learning.

SEE ALSO

python(1), R(1), matlab(1), octave(1)

Copied to clipboard