How is Pluto.jl different from Jupyter?
Pluto.jl was built from the ground up to be a fresh new notebook system, written in Julia. The main differences are that Pluto notebooks are reactive, and that your notebooks are stored as executable .jl files.
.jl
Whatโs the deal with reactivity?
You use cells to define variables and functions to be used later. In a reactive notebook, changing a variable or function will automagically re-evaluate all other cells that use it. Just like a speadsheet editor! Programming is hard sometimes. Even more so when you need to keep track not only of your code, but also of your sessionโs hidden state. Pluto gives you confidence that the code you see exactly matches the variables youโre working with, eliminating bugs before you even knew you had them.
You use cells to define variables and functions to be used later. In a reactive notebook, changing a variable or function will automagically re-evaluate all other cells that use it. Just like a speadsheet editor!
Programming is hard sometimes. Even more so when you need to keep track not only of your code, but also of your sessionโs hidden state. Pluto gives you confidence that the code you see exactly matches the variables youโre working with, eliminating bugs before you even knew you had them.
Will all cells be re-evaluated when I change something?
No. Pluto.jl figures out the dependency graph between cells, and knows exactly which cells to re-evaluate, in which order. A cell never executes twice.
Will my code be slower?
Nope - Pluto.jl analyses your code, and then executes the code without modifications. Variables and functions are not wrapped in special objects. After analysis, your code will run on its own.
Can I use Plots?
Plots
Yes you can! All plotting back-ends should work right away.
How to use multiple threads in Pluto.jl? nthreads() says 1 somehow
nthreads()
You can, but you need to set JULIA_NUM_THREADS environment variable as described in the documentation for the worker spawned by Pluto.jl to pick up.
JULIA_NUM_THREADS
worker
Can I use [my favourite package]?
[my favourite package]
Yes you can! (Probably!) Your code is evaluated as-is, so if it works in the REPL or in Jupyter, it will work in Pluto.jl. There are some exceptions: packages that are made specifically for the REPL or Jupyter Distributed, and packages that use it (#300)
Yes you can! (Probably!) Your code is evaluated as-is, so if it works in the REPL or in Jupyter, it will work in Pluto.jl. There are some exceptions:
Distributed
Can I open multiple notebooks at the same time?
Yes! Click on the logo ( ) to go back to the welcome screen. You can use your browser tabs to see multiple notebooks simultaneously.
Can I use Pluto remotely?
If the server (where Pluto will run) and the client (the machine whose browser will use Pluto) are on the same network then set the host to 0.0.0.0 while launching Pluto (e.g Pluto.run(host="0.0.0.0"). An example use case is if you have a headless raspberry pi and a laptop connected to the same wi-fi network in your home. You can run Pluto on the raspberry-pi and use your laptopโs browser for development. However if the server is remote and has a public ip you need to set up an SSH tunnel. First, log in to your server using SSH and start a Pluto server. Then open a local terminal on your own computer and type: ssh user@ipaddress -N -L 1234:localhost:1234 with user and ipaddress filled in accordingly. You can then go to http://localhost:1234/ on your own computer to get started! For more info and instructions for Windows, see this guide. This can come in handy if your server is on a cloud service such as AWS or Azure. The latter method can be used in the former case too provided an ssh client is available and enabled on both machines.
If the server (where Pluto will run) and the client (the machine whose browser will use Pluto) are on the same network then set the host to 0.0.0.0 while launching Pluto (e.g Pluto.run(host="0.0.0.0"). An example use case is if you have a headless raspberry pi and a laptop connected to the same wi-fi network in your home. You can run Pluto on the raspberry-pi and use your laptopโs browser for development.
0.0.0.0
Pluto.run(host="0.0.0.0"
However if the server is remote and has a public ip you need to set up an SSH tunnel. First, log in to your server using SSH and start a Pluto server. Then open a local terminal on your own computer and type:
ssh user@ipaddress -N -L 1234:localhost:1234
with user and ipaddress filled in accordingly. You can then go to http://localhost:1234/ on your own computer to get started! For more info and instructions for Windows, see this guide. This can come in handy if your server is on a cloud service such as AWS or Azure. The latter method can be used in the former case too provided an ssh client is available and enabled on both machines.
user
ipaddress
http://localhost:1234/
Can I use @async to update values reactively on demand?
@async
Unfortunately not. Pluto.jl uses static code analysis to determine which cells to run next โ it does not use wrappers or a polling mechanism to watch variables in real-time. However, the @bind macro might be able to do what you want! Have a look at the Interactivity sample inside Pluto. Feel free to open a GitHub issue if this doesnโt suit your needs.
@bind
How can I load startup.jl?
startup.jl
We want your notebooks to be reproducible, so our suggested method is that you copy and paste your personal setup script into a begin ... end block inside your notebook. This avoids implicit dependencies of your notebook. Alternatively, you could write include("path/to/startup.jl"), but this will only work on your computer.
begin ... end
include("path/to/startup.jl")
How can I load a notebook upon launching Pluto?
You can pass the notebook keyword argument to Pluto.run, e.g. Pluto.run(notebook="/path/to/notebook.jl").
notebook
Pluto.run
Pluto.run(notebook="/path/to/notebook.jl")
How can I use a sysimage inside Pluto?
Pluto.run() takes a keyword argument sysimage which can be used to add sysimage used by each notebook. To load the currently loaded sysimage, start pluto using:
Pluto.run()
sysimage
Pluto.run(sysimage=unsafe_string(Base.JLOptions().image_file))