Julia for plebs, part 1
Using Julia
So, the best way to use Julia depends on what do you want to do?
-
If you do not want to install Julia but learn, easiest is Google Colab or Juliahub then Pluto notebook
-
If you want to install and learn, use any plain text editor, edit a file say analysis.jl and in a terminal type Julia to bring up the REPL and type include(“analysis.jl”) and off you go
-
If you want to learn on your own machine step by step, open Julia REPL then install Pluto as follows:
-
press ]
-
type “add Pluto”
-
then after it installs Pluto, do:
-
using Pluto; Pluto.run() This will open up your default web browser and will ask you to select a file or start a new file. If you have never used Pluto, there is a bit of learning that I will write about, but this is perhaps the best thing to learn and produce formatted code and documentation in one go. Amazing app
-
If you want an IDE, use VSCode or Code open source. This is feature rich and Julia works very well
-
You can also use a Jupyter Notebook and run Julia. Do as follows:
-
From your Julia REPL, type ]
-
Brings up Pkg interface, type add IJulia
-
then after it installs, exit the Pkg interface with backspace or delete if you are on Mac then
-
in the REPL type using IJulia
-
It will bring up the Jupyter Notebook in your default web browser.
If you want to use a code editor and work with Julia including VSCode or CodeOSS (open source), you will need to install the LanguageServer package from Julia. You can do so from Julia REPL with first bringing up the Pkg interface and then typing “add LanguageServer”.
You will need this and any other language server protocol that your code editor would prefer. The most useful code editors other than IDEs I have used for Julia are:
- BBEdit for Mac
- neovim (Mac/Linux/Win)
- SublimeText (Mac/Linux)
- Notepad++ (Win) -EMacs (All platform)
In the next post, I will write about how to code in Julia.