# Pluto + REPL

**URL:** https://discourse.julialang.org/t/pluto-repl/90277
**Category:** Pluto
**Tags:** repl, pluto
**Created:** [November 15, 2022, 8:45am UTC](https://discourse.julialang.org/t/pluto-repl/90277 "2022-11-15T08:45:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)
#### Post date: [November 15, 2022, 8:45am UTC](https://discourse.julialang.org/t/pluto-repl/90277/1 "2022-11-15T08:45:36Z")

</div>

I love Pluto. But I also love REPL and sometimes some things still feels better off to be done there.  
These mostly include fast evaluations and IO operations.  
Do you have any setup/ideas how to synchronize a Pluto notebook with a REPL ?

**My attempts**

1. 

First I tried using [Revise.jl](https://github.com/timholy/Revise.jl) to actually reproduce the notebook kernel to a REPL.  
I activated the environment of the specific Pluto notebook.  
Then I [configured](https://timholy.github.io/Revise.jl/stable/config/#Configuring-the-revise-mode-1) the Revise mode to track also data using `:evalassign` and I `includet` the Pluto notebook.  
This works quite well but soon you fall into pitfalls like changing the following cells

```julia
### Pluto notebook
# ╔═╡ dbfda0d4-8be5-4858-b682-0b43d2464c36
x = 1

# ╔═╡ e63564a4-9727-4cf8-8523-5bc9ee5122af
y = x + 10

```

to

```julia
### Pluto notebook
# ╔═╡ dbfda0d4-8be5-4858-b682-0b43d2464c36
x = 5 # changed

# ╔═╡ e63564a4-9727-4cf8-8523-5bc9ee5122af
y = x + 10

```

will only update `x` to REPL kernel and will leave `y` to the previous value (11).  
In other words the expression dependencies are not evaluated.  
To bring your REPL in tune with the notebook you need to `include` the notebook again, or manually evaluate all needed expressions.

Do you have any other ideas how can this state be more closely tracked and evaluated ?  
(this starts getting very similar to what the reactiveness of `Pluto` is meant to do)

1. 

I also tried using [RemoteREPL.jl](https://github.com/c42f/RemoteREPL.jl).  
This way I do not create another kernel that I try to keep synchronized but I really use the kernel of the notebook. As such you don’t have to worry about dependent evaluations and synchronization.  
You will need to [evaluate commands inside the module](https://docs.juliahub.com/RemoteREPL/c55rY/0.2.17/howto/#Evaluate-commands-in-another-module) of the Pluto notebook.  
It might sounds better, but in the end I got more implications, mostly because I realized everytime I modify a cell in Pluto a new module is created. As a result it is hard to follow with the remote REPL.

This thread is meant to initiate a discussion among the people seeking the same thing: a harmonic interplay between Pluto and REPL. Do you have any other ideas for such a venture or maybe some improvements to suggest ?

_PS I don’t mean to externally modify the state of a Pluto notebook, but rather just being able to quickly and conveniently evaluate it from a REPL. I still see the fact that Pluto notebook generates a consistent state as an advantage._

---

<div class="post-metadata">

### Author: ![LeePhillips](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leephillips/32/205514_2.png) [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)
#### Post date: [November 16, 2022, 1:56pm UTC](https://discourse.julialang.org/t/pluto-repl/90277/2 "2022-11-16T13:56:52Z")

</div>

I usually interact with the REPL through my editor, nvim (also works with classic vim). All the code is in the editor, and (using a choice of many available plugins) I can select code and send it to the REPL for evaluation, all with a few keystrokes. The code in the editor can be the Pluto file, which is a Julia program like any other. Information about the cell presentation is kept in specially formatted comments.

---

<div class="post-metadata">

### Author: ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)
#### Post date: [August 26, 2024, 5:44pm UTC](https://discourse.julialang.org/t/pluto-repl/90277/3 "2024-08-26T17:44:59Z")

</div>

RemoteREPL v0.3.0 makes REPL and Pluto.jl integration pretty neat!  
Read the docs to know more: [How To · RemoteREPL.jl](https://juliaweb.github.io/RemoteREPL.jl/dev/howto/#More-on-Pluto)  
Thanks @c42f for helping out on this release !

A small video of how that looks:

> **[remotereplpluto-2024-08-26\_19.30.40.mp4](https://drive.google.com/file/d/1yynBHrjmTe73ycYGWMwlwOl74gntJq7p/view)**
>
> Google Drive file.

There is some boilerplate from the Pluto side. Pluto is currently polling instead of using an event-based approach. So if you have any better ideas please let us know to update the docs! Pinging @fonsp for any ideas 🙂
