Julia IDEs
Integrated Desktop Environments (IDEs) are integrated tools that provide a complete environment for software development and testing. IDEs provide visual support for the development process, including syntax highlighting, interactive code editing, and visual debugging.
Getting ready
Before installing an IDE, you should have Julia installed (either from binaries or source), following the instructions given in previous recipes.
Note
In the GitHub repository for this recipe, you will find the SublimeText.txt
file that contains configuration for Sublime Text described in this recipe. The configuration process of other IDEs described in this recipe is completely done with a point and click interface.
How to do it...
The three most popular Julia IDEs are Juno, Microsoft Visual Studio Code, and Sublime Text. In subsequent sections, we discuss the installation process for each particular IDE.
Juno
Juno is the recommended IDE for Julia development.The Juno IDE is available athttp://junolab.org/. However, Juno runs as a plugin to Atom (https://atom.io/). Hence, in order to install Juno, you need to take the following steps:
- Make sure that you have installed Julia and added it to the command path (following the instructions given in previous sections).
- Download and install Atom, available athttps://atom.io/.
- Once the installation is complete, Atom will start automatically.
- PressCtrl + , (Ctrl key + comma key) to open the Atom settings screen.
- Select the
Install
tab. - In the
Search packages
field, typeuber-juno
and pressEnter. - You will see the
uber-juno
package developed by JunoLab—clickInstall
to install the package. - In order to test your installation, click the
Show console
tab on the left.
Please note that when being run for the first time from Atom, Julia takes longer to start. This happens because Juno is installed along with several other packages that are being compiled before their first use.
Microsoft Visual Studio Code
Note that at the time of publishing this book the Microsoft Visual Studio Code does not yet support Julia 1.0. However, since we believe that this support will be available very soon, we provide the instructions below.
The Microsoft Visual Studio Code editor can be obtained fromhttps://code.visualstudio.com/.Simply download the installer executable and install using the default settings. After launching Visual Studio Code, perform the following steps:
Click
Extensions
tab (or press Ctrl + Shift + X).In the search box, type
julia
. You will seeJulia Language Support
on the list. Click the greenInstall
button to start the installation.Click
File
|New File
to create a new, empty file.Click
File
|Save As...
to save the newly created file. In theSave As...
typeJulia
(please note that the file type list might not be sorted alphabetically and Julia type might be at the bottom of the list).Open the Terminal tab and issue the
julia
command.
After following these steps, you will have a Julia file open in the editor and an active Julia Terminal. PressingCtrl + Enter will now send the currently highlighted code line to the Terminal to execute it.
Sublime Text
Another option for the IDE is utilizing the functionality of Sublime Text:
- If you are using Sublime Text, then add the package named
Julia
throughPackage Control
.
- Next, the simplest thing to add is a custom build system for Julia (
Tools
|Build System
|New Build System
):
{ "cmd": ["ConEmu64", "/cmd", "julia -i", "$file"], "selector": "source.julia" }
- Now, you can execute an opened Julia script by pressingCtrl + B in the console in interactive mode (
-i
switch).
The preceding example assumes thatConEmu64
andjulia
are defined in the search path.
The only inconvenience of this method is that if there is an error in the Julia script, the console will be immediately terminated (a cleaner way to test your scripts is to keep your Terminal with Julia open) and use theinclude
command, as explained in the recipe Useful options for interaction with Julia in this chapter.
See also
For integration with other editors and IDEs, take a look at the https://github.com/JuliaEditorSupport project.