Using Python and OCaml in the same Jupyter notebook
11–20 of 35 posts
Re: Using Python and OCaml in the same Jupyter notebook
#12The jupyter-notebook interface is IMO, not really suited for interactive development. Notebooks enforce code to be broken up into pieces of cells to be evaluated. The code must be written in a specific linear way to cater the format of notebooks. Also the distinction between the code & notebooks are too big, it's clunky to move between. You get to resort copy-pasting back-and-forth. It's always frustrating when I try…
For python, visual studio code has some of this integration. It still runs a jupyter kernel, but will run "cells" directly from your source code file (where the cells are delimited by "# %%" comments) and output to a separate pane with a jupyter-driven repl in it. I accidentally discovered this after exporting a jupyter notebook to python and opening it in vscode.
Still just merging the notebooks into the editor is a big step. :-)
Re: Using Python and OCaml in the same Jupyter notebook
#13Re: Using Python and OCaml in the same Jupyter notebook
#14Re: Using Python and OCaml in the same Jupyter notebook
#15I have used the Haskell TensorFlow bindings, but the OCaml examples look more straightforward.
Re: Using Python and OCaml in the same Jupyter notebook
#16The jupyter-notebook interface is IMO, not really suited for interactive development. Notebooks enforce code to be broken up into pieces of cells to be evaluated. The code must be written in a specific linear way to cater the format of notebooks. Also the distinction between the code & notebooks are too big, it's clunky to move between. You get to resort copy-pasting back-and-forth. It's always frustrating when I try…
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.
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
#17Earlier quoted context omitted.
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.
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 probab…
Re: Using Python and OCaml in the same Jupyter notebook
#18The jupyter-notebook interface is IMO, not really suited for interactive development. Notebooks enforce code to be broken up into pieces of cells to be evaluated. The code must be written in a specific linear way to cater the format of notebooks. Also the distinction between the code & notebooks are too big, it's clunky to move between. You get to resort copy-pasting back-and-forth. It's always frustrating when I try…
We have solved this problem by providing 2-way sync between notebooks and libraries, using a system called nbdev:
Re: Using Python and OCaml in the same Jupyter notebook
#19Very cool, but expected a pic of snake riding a camel
Re: Using Python and OCaml in the same Jupyter notebook
#20The jupyter-notebook interface is IMO, not really suited for interactive development. Notebooks enforce code to be broken up into pieces of cells to be evaluated. The code must be written in a specific linear way to cater the format of notebooks. Also the distinction between the code & notebooks are too big, it's clunky to move between. You get to resort copy-pasting back-and-forth. It's always frustrating when I try…