Here's an example emacs configuration:
(use-package jupyter
:after org
:config
(org-babel-do-load-languages 'org-babel-load-languages '((jupyter . t)))
;; default args for jupyter-python
(setq org-babel-default-header-args:jupyter-python
'((:results . "replace")
(:async . "yes")
(:session . "py")
(:kernel . "python3"))))
After that, you could execute jupyter code block (Org Babel): #+begin_src jupyter-python
1+1
#+end_src
#+RESULTS:
: 2
You can use latex in org-mode, generate pictures, get nice git diff, export it to pdf, etc.Essentially a good implementation of Python code blocks would reimplement half of Jupyter anyway.
We don’t use the term “literate programming” much anymore, the concept of “reproducible reports” resonates much more with R users. But the experience is much the same.
(Disclosure: employed at RStudio)
It sounds silly, but when there’s a lot of work do in terms of writing the literature part, and then adding the actual code part, I’m much happier with vim than I am with the browser based editor.
(This is for producing literate programs for the purpose of teaching others, not for my own benefit.)
Most of my Jupyter notebooks are just code, but I've got some with long Latex mathematical derivations of formulas that appear in the code. I would actually like to be able to have that kind of thing in comments within the code itself. I don't do literate programming really though.
In Org Mode, you get all the syntax highlightings and keybindings for whatever language's mode if you do literate programming with it.
What you won't get are things like being able to integrate your compilation failures, etc. As an example, if you write something that fails to compile, Emacs will not quickly be able to take you to the line that caused the failure. Similarly, things like linting, etc typically break.
Frustratingly, if you get an exception (e.g. "KeyError" in Python), it will not show the result of any print statements, so debugging is a bit painful.
I'm sure someone can solve these problems, but I don't know that anyone has.
https://github.com/jingtaozf/literate-clojure
but ran into this
https://github.com/polymode/poly-org/issues/20
Either some IDE like functionality doesn't work or syntax highlighting doesn't work after you go through additional complexity compared to simply starting a project.
Thinking about it, is Jupyter Notebooks (and the like) a form of literate programming?
Thinking even more about it, I think I actually used (or tried to) literate programming in a course about Machine Learning using R and – if I remember correctly – LaTeX to generate the actual application and a PDF.