back

by WolfOliver·6y ago·view on hn ↗
would be curious what Jupyter notebooks things are better with Pluto.jl, can you name some concrete points?
3 comments
1. Dependency graph for cells, letting it automatically rerun what's needed when you change one. This keeps everything up to date.

2. git-friendly.

I wonder how they are doing it? simply re-evaluating every cell?
It's mentioned in the video [1], it does static analysis of the code to create a graph of dependencies (for example which cell uses a variable defined by another cell), so when you update any cell it will find what cells are affected by the change (the downstream nodes on a directed acyclic graph) and only evals the code on them (instead of running everything). Julia is particularly good for those kind of code analysis since it's a very Lispy language.

It also does a trick of creating new modules to manipulate scope to make deleted variables/import/cells invisible (and therefore free to be garbage collected).

[1] https://youtu.be/IAF8DjrQSSk?t=596

Reproducibility is a huge one for me. I’m often doing exploratory work that I’ll want to save in its current state and pick back up a few months (or even years) later. With Jupyter, this almost never works because I am constantly editing and running cells out of order as I’m exploring things. If I save at any given point, there is no guarantee that the notebook will be in the same state when I reopen it and re-run the cells.

With Pluto and other reactive notebooks, you have a guarantee that the code you see on the screen will produce the same results. So if you go back and edit cells out of order, save the notebook, then open it and re-run later, it will always be in the same state you left it in.

In addition to what celrod said: Jupyter doesn't have an equivalent of Pluto's @bind macro, does it?
It's not as elegant but kinda exists

https://ipywidgets.readthedocs.io/en/latest/

Thank you! I hadn't seen that.