3 Great Julia Editors — VSCode, Juno and Jupyter Notebooks | by Alan Jones | Towards Data Science

Julia is a young language and so support is not as comprehensive as it is for other more established languages such as Java or Python. However, while there may not be a vast number of development environments available for it, you do have the choice of some good ones.
I’m going to introduce you to my favorites; this won’t be a comprehensive guide, just a brief overview but, I hope, useful.
The choice of editor or IDE is to some extent subjective and so the three environments that I have chosen to talk about here are bound to reflect my own prejudices.
They are all open source and thus free, and they are: Visual Studio Code from Microsoft, Juno, which is promoted by the Julia language people themselves and is based upon the Atom editor, and finally Jupyter Notebooks.
All of these environments support multiple languages and each requires its own plugin or extension to customize it to support Julia.
Juno and VSCode are fairly conventional IDEs, the sort of thing you might use for many types of software or web development. Jupyter Notebooks is not a conventional IDE and is more associated with Data Science and the Python language but it is also perfect for Julia (and other languages, too). That being said, you probably wouldn’t want to develop large Julia programs with Jupyter; it is much better suited to the relatively short routines that data scientists or data journalists are likely to want to use.
I’ll come to Jupyter last and of the two conventional IDEs, I’ll start with the one that is probably most associated with the Julia language.
(Update: it seems that Juno is no longer being developed and that the development effort has been moved to the Julia extension for VSCode)
If you go to the Julia language home page ( julialang.org) one of the things you will be invited to do is download the JuliaPro package. This is the Juno IDE bundled with the Julia language. You need to register to download JuliaPro but it is free.
Alternatively, if you already have Julia, you can download and configure Juno very simply. This is the route I took and it comprises of a few simple steps. First, download the Atom editor, then from within the editor download and install ‘uber-juno’ the Juno extension and, when it has finished tell the Juno extension where the Julia binary is.
Follow the Juno link on the Julialang web site for full instructions, it’s quite straightforward although on my rather weak and feeble Linux machine, installing the extension took a while. If you have a reasonably up-to-date computer with a decent amount of memory, you probably won’t have to wait too long.
When you start Juno you will see what looks like a normal Atom editor but with the addition of a Juno menu and Juno controls down the left side of the window.
To run a file simply open it from the file menu and then click the run icon (like a play button) and two things will happen. First a Julia console, or REPL is started (you can also start this manually) and then the program will run with any output sent to the console.
A word of warning: the first time that I ran a program it took a long time to start Julia, so you may need to be patient. Subsequent runs were much quicker.
Below, you can see a screen shot of Juno running a simple plotting program. There is no output to the console but you can see that the plot is drawn in its own window.
As you would expect from a fairly sophisticated IDE, Juno has code completion, a debugger and you can write interactive commands in the REPL.
Again,as with Juno, the first run took a while to get going. Subsequent runs were quicker and, it may be my imagination, but it felt that VSCode might be marginally quicker than Juno.
Jupyter is not a conventional IDE. It consists of cells that can be either code or text and which can be executed individually. In the screenshot below you can see the same plotting program in a single code cell and the output — the graph — just below it.
Typically, another cell would be opened below the first with the next bit of code to be executed. These code cells can have text cells interspersed between them — the text being in Markdown — so allowing for the creation of a complete executable document comprising of rich text and program code.
You wouldn’t use Jupyter to develop conventional programs but for the data scientist or data journalist who wants to manipulate and analyse data it can be a great tool.
To use Jupyter as a tool for Julia you will need to download and install both (you will also need Python to run Jupyter). The easiest way to install Jupyter and Python simultaneously is to use Anaconda — I’ve already written an article about this, so rather than repeat myself, please take a look at this: Setting Up Jupyter Notebooks for Data Visualization with Anaconda.
By default, Jupyter uses the Python language. To let Jupyter know about Julia, start up Julia and you will see the command prompt in a window like this (it’s the same REPL as you see in the editors):
Then type this at the prompt and the press <return>:
using Pkg
this tells Julia that you are going to use the package manager. Then type the following and hit <return>:
Pkg.add("IJulia")
IJulia is the package that will provide the connection between Jupyter and Julia. You may need to wait while it downloads and installs.
Once you have installed IJulia you can close the Julia window. When you start up Jupyter, you will be able to open a new Julia Notebook instead of Python (though Python will still be an option).
One of the advantages of Julia over Python is that it is fast. This is great if you have a lot of processing to do. However, the speed comes from compiling the Julia code into lower level code and this in itself takes time.
This compilation takes place the first time you run a program and so this first run takes considerably longer than subsequent ones: if you run the same program a second time you will notice that it is much faster.
I use Jupyter to develop both Python and Julia code particularly for articles like this. I like the way I can use a prototyping approach, writing small pieces of code at a time, trying them out and then moving on to the next part.
With both of the IDEs you can run blocks of code and so work in a similar way to this but, of course, you cannot include text cells.
So, if I was writing an article or a report that required me to build up small pieces of code with descriptive text then I would definitely use Jupyter. On the other hand if I was writing a single standalone program, I’d use a normal IDE, either Juno or VSCode.
To be honest, I can’t decide which is best which is why I use all three!
Why not try them all out and see which you are most comfortable with.
You might also be interest in:
towardsdatascience.com
towardsdatascience.com
Originally published at https://projectcodeed.blogspot.com on June 6, 2020.