- Visit Julia home page to download pre-built binaries and access documentation
- Install VSCode, and install Julia Language extension
- For an interactive environment, try Pluto
Install these packages in your root environment:
Create a new directory and change to that directory.
mkdir project1
cd project1
Start Julia REPL with the following command:
julia --project=.
Install any packages that you want to use. First press ]
to go into Pkg mode, then:
add CSV
add DataFrames
etc.
Use a text editor, create an empty script (e.g. script.jl) and save into this directory.
Enable Revise and monitor the script.
using Revise
includet("script.jl")
From this point on, you can start writing functions in the script file. When you are ready to test, save the file and switch over to the REPL to call that function.
For example, let's say the script has:
function hello()
println("world")
end
You just go to the REPL and call it:
hello()
Start Julia REPL and generate a new package as follows:
] generate MyPackgae
It shoud create a new MyPackage
directory. Exit REPL and change to that directory.
cd MyPackage
Restart Julia REPL with the following command:
julia --project=.
Install any packages that you want to use. First press ]
to go into Pkg mode, then:
add CSV
add DataFrames
etc.
Import Revise and your package:
using Revise, MyPackage
From this point on, you can update any source code in the package directory. When you're ready for testing, switch back to the REPL and call any function:
MyPackage.hello()
You don't need to prefix with MyPackage
for exported functions.