427 points · by type_enthusiast · 7y ago · 85 comments
> Writing Polynote’s code interpretation from scratch allowed us to do away with this global, mutable state. By keeping track of the variables defined in each cell, Polynote constructs the input state for a given cell based on the cells that have run above it. Making the position of a cell important in its execution semantics enforces the principle of least surprise, allowing users to read the notebook from top to bottom. It ensures reproducibility by making it far more likely that running the notebook sequentially will work.
https://nbviewer.jupyter.org/github/friggeri/notebooks/blob/...
#Cell 1
a = [1,2,3]
b = (a,True)
#Cell 2
b[0][0] = 5
#Cell 3
print(sum(a))
Now if I change Cell 2 to # Cell 2'
b[0][0] = 4
and execute, Cell 3's result becomes stale. Do you track such dependencies? Would really love to read more about the underlying implementation.Currently it takes a shallow copy of the state output by each cell, meaning every value is going to be a primitive value or a reference. If it's a reference to mutable state, you're kind of on your own with respect to keeping reproducibility. I felt like this was a good compromise between strictly enforced reproducibility and practicality; if it turns out to be confusing we could consider deep copying the state, or having an option to do that (I could imagine it being pretty bad for efficiency in a lot of ML use cases, though).
Personally, I'm looking forward to trying out the SQL support. I haven't seen an elegant solution for SQL notebooks in Jupyter, it was always second-class via Python or some such. Or have I missed something?
Interesting. Judging by that it seems to be implemented with a JVM language and a screenshot shows "Scala" as a supported language, I'm guessing at least all the JVM languages are supported (personally hope for Clojure) but can't seem to find a list of supported languages anywhere in the post or on the website.
What languages are supported by Polynote?
https://github.com/polynote/polynote/blob/08f0751138e2991cf7...
Closest thing that comes to mind is something like Apache Drill, which coincidentally also uses Apache Calcite as the SQL interpreter.
Also wondering why I would use this over Zeppelin which can support other interpreters like Flink?
As ever, the best answer is the Notebooks Are Bad, Actually
We've had some better options contributed in the past couple of weeks, but as long as we're going to change it I didn't want to rush that. So we stuck with my questionable typographic treatment for the blog post.
(Edit: autocorrect typo)
(this looks fantastic btw, I'm definitely going to explore it more in depth. thank you a TON for releasing it!)
Also not a physicist FWIW <3
That project experimented with a lot of interesting themes I see echoed here.
It's nice know that your report actually worked, and is not showing something odd because of a hidden state, but sometimes you just want to print the darn thing now!
The server use case is real, though. Users typically like to run it on a beefy cloud machine with access to a Spark cluster.
https://www.jetbrains.com/help/pycharm/jupyter-notebook-supp... https://www.jetbrains.com/help/idea/jupyter-notebook-support... https://code.visualstudio.com/docs/python/jupyter-support
For you they are not meant that way. But other people started using them that way. Netflix is a well known place for this workflow.
I mean something like these:
https://www.sec.gov/Archives/edgar/data/826083/0001193125131...
https://www.sec.gov/Archives/edgar/data/826083/0001193125131...
https://www.sec.gov/Archives/edgar/data/826083/0001193125131...
Alternatively build something more tightly integrated to MS Office and sell it to Microsoft