Re:Using Python and OCaml in the same Jupyter notebook
by snackematician on Friday December 20, 2019 @01:27PM
(#21846293)
Another complaint I have with jupyter notebooks is that they don't play nice with git. For this (and other reasons), I much prefer Emacs org-mode, or even running Python in Rmarkdown+Rstudio+reticulate.
[ Parent
| on HN ]
Re:Using Python and OCaml in the same Jupyter notebook
by arminiusreturns on Friday December 20, 2019 @02:12PM
(#21846625)
I second emacs-org mode. It is extremely powerful though I don't know if it addresses GPs concerns. You could just execute the compiler etc against the actual program from within the code block and then "+CALL" in other sections to avoid the copypasta'ing I guess. I don't do very advanced stuff so I haven't run into problems with just using code in the blocks.
The main problem with emacs org-mode is that users probably need to use emacs, and lots of people have their own editor preferences, and while some have org-mode-alike's, they aren't as fully capable as emacs org-mode. Which is what Jupyter addresses by making the interface more accessible/editable to all.
That said, I think one of the most important factors that the linear notebook flow encourages is a focus on reproducibility, whether it's Jupyter or Org-Mode. I feel like overcomplicating the dev environment would make the much harder and would at least need to be planned for.
Re:Using Python and OCaml in the same Jupyter notebook
by tincholio on Friday December 20, 2019 @02:26PM
(#21846716)
You can also extract the code via tangling so you can run it outside emacs.
Re:Using Python and OCaml in the same Jupyter notebook
by optimali2 on Friday December 20, 2019 @03:10PM
(#21847008)
Even more you can compose a jupyter notebook from an org file
Re:Using Python and OCaml in the same Jupyter notebook
by arminiusreturns on Friday December 20, 2019 @06:54PM
(#21848457)
I didn't know that! Cool!
Re:Using Python and OCaml in the same Jupyter notebook
by dual_basis on Friday December 20, 2019 @01:35PM
(#21846383)
Jupytext solves this for me completely. It is an extension to jupyter code which can be turned on (globally or per-notebook, with additional configuration options) which automatically syncs the notebook to a file which can be checked into git and has nice diffs. It is a two-way binding, so editing the file will include those changes in jupyter, and if you check out a file in that format it can be converted into a jupyter notebook on your side easily as well.