“The notebook interface was the brainchild of Theodore Gray, who was inspired while working with an old Apple code editor. Where most programming environments either had you run code one line at a time, or all at once as a big blob, the Apple editor let you highlight any part of your code and run just that part. Gray brought the same basic concept to Mathematica, with help refining the design from none other than Steve Jobs.”
The original IPython notebook was consciously imitating Mathematica.
I don’t think it quite makes sense to compare these notebooks to Knuth’s literate programming. The whole point of that was that you could present things out of order, which is impossible and actually a huge pain point for notebooks.
> What was the earliest of these tools? Mathcad? Mathematica? Maple?
The first version of MathCad (for DOS) came in 1986, but it's difficult to find info on how it looked like. Did it already have the notebook interface? This is how MathCad looked in 1989:
there’s a relatively esoteric paradigm known as “literate programming” which has been around since Knuth (he wrote the book [0]) and that has some software tools associated, of which Jupyter is a particularly web-age example.
Literate programming was esoteric, true, but the concept saw a huge renaissance in academia and data science with the advent of RMarkdown¹ which for many of my colleagues is the default way of preparing technical documents. Another area in which literate programming has become hugely popular is Emacs' Org-mode ecosystem which has fantastic support in the form of Org Babel². I use literate programming for almost everything. Research papers, tech reports, notes, experiments, teaching materials, letters, student evaluations, and so on. It's completely ridiculous how useful it is once you get the hang of it and make it your default document type.
I'm still not sold on writing complete program this way (I did try, with various level of success), but even partially-literate approach is ridiculously convenient if you happen to live in Emacs.
I do my task management and note-taking in Org-mode, and recently I found myself doing things like jotting in the middle of my notes[0]:
#+BEGIN_SRC http
GET address.to.api:123/sth
#+END_SRC
and tapping CTRL+C twice, to get the actual response of the API I was debugging.
Or, the other day I was making notes about gravity batteries, and was wondering how efficient is one startup's solution. I briefly thought about firing up Jupyter, but then simply wrote the following[1]:
these guys power a LED (or three?) with a 0.1W, generated through dropping
a 12kg weight down 1.8 meters over 20 minutes.
Doing some basic math on that:
#+BEGIN_SRC elisp
(let* ((m 12)
(g 9.81)
(h 1.8)
(_t (* 20 60))
(E (* m g h)) ; E = m*g*h
(P (/ E _t)) ; P = E/t
(efficiency (/ 0.1 P)) ; efficiency = Pout/Pin
)
`("ideal power [W]" ,P
"efficiency [1]" ,efficiency))
#+END_SRC
(which is automatically rendered as an org-mode table I can operate on, or even reference in other code snippets).
Point being, note-taking in org mode makes it ridiculously easy to invoke any programming language you hooked up to Emacs without breaking your flow, and you get to edit the code in the mode specific to that programming language - so everything from autocomplete to linters work.
I know Emacs is niche, but I can't recommend it enough.
--
[0] - BEGIN/END_SRC block is under convenient autocomplete of "<s TAB".
[1] - this is a real note, so if I got the physics wrong, I just made a fool of myself publicly -.-
Just being a smart-aleck, of course, but scientists have been using interactive programming tools since they became available, and they have only grown in sophistication.