Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dynamic Notebooks & Literate Programming

Sam Ritchie
February 13, 2021

Dynamic Notebooks & Literate Programming

Slides from the [London Clojurians Meetup](https://clojureverse.org/t/london-clojurians-talk-dynamic-notebooks-and-literate-programming-by-sam-ritchie/6846) in January 2021.

This talk will introduce Sam’s current effort to create a networked, stateful, literate programming system in Clojure. We’ll discuss the history of literate programming and the creation of “microworlds”, and how Clojure has a special edge in the search for humane computing interfaces.

Sam Ritchie

February 13, 2021
Tweet

More Decks by Sam Ritchie

Other Decks in Programming

Transcript

  1. Literate Programming
    Wh
    a
    t’s Here, Wh
    a
    t’s Next
    S
    a
    m Ritchie (@sritchie) London Clojuri
    a
    ns Meetup, J
    a
    nu
    a
    ry 2021

    View Slide

  2. • Code writer!


    • Code READER!


    • Currently at (Google) X, leaving on Friday for the Mentat Collective


    • Sucker for even the phrase Literate Programming!
    Sam Ritchie

    View Slide

  3. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  4. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  5. View Slide

  6. Don
    a
    ld Knuth, Liter
    a
    teProgr
    a
    mming.com
    I believe that the time is ripe for signi
    fi
    cantly better documentation of
    programs, and that we can best achieve this by considering programs
    to be works of literature. Hence, my title: "Literate Programming.”


    Let us change our traditional attitude to the construction of
    programs: Instead of imagining that our main task is to instruct a
    computer what to do, let us concentrate rather on explaining to
    human beings what we want a computer to do.

    View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. Doug McIlroy: “ Progr
    a
    mming Pe
    a
    rls: A Liter
    a
    te Progr
    a
    m", CACM, June 1986, pg. 478-479
    The presentation is engaging and clear. In WEB one deliberately
    writes a paper, not just comments, along with code. This of
    course helps readers. I am sure that it also helps writers:
    re
    fl
    ecting upon design choices su
    ff i
    ciently to make them
    explainable must help clarify and re
    fi
    ne one's thinking. Moreover,
    because an explanation in WEB is intimately combined with the
    hard reality of implementation, it is qualitatively di
    ff
    erent from,
    and far more useful than, an ordinary "speci
    fi
    cation" or "design"
    document. It can't gloss over the tough places.

    View Slide

  12. View Slide

  13. ~Doug McIlroy

    View Slide

  14. Power Series, Power Serious

    View Slide

  15. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  16. We SORT of are…

    View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  21. The Philosophy of Tools
    • Tools come with an embedded philosophy!


    • The UNIX philosophy is COMPOSABILITY of focused tools


    • Knuth’s focus was on NARRATIVE, Presentation


    • Clojure’s Philosophy?

    View Slide

  22. The Philosophy of Tools
    PRESENTATION vs Discovery


    [[Path Through the Graph]] vs [[Building the Graph]]

    View Slide

  23. View Slide

  24. View Slide

  25. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  26. View Slide

  27. View Slide

  28. View Slide

  29. Tools

    View Slide

  30. Query Optimizer

    View Slide

  31. th.ing Geometry

    View Slide

  32. View Slide

  33. View Slide

  34. Marginalia

    View Slide

  35. View Slide

  36. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  37. View Slide

  38. View Slide

  39. H
    a
    l Abelson, Structure
    a
    nd Interpret
    a
    tion of Computer Progr
    a
    ms
    “Programs must be written for people to read,
    and only incidentally for machines to execute.”

    View Slide

  40. Goal:
    • Do ALL the exercises!


    • SHARE them in a format that is easy and simple to execute for…
    my non-coding parents.


    • Make a wonderful environment for students in the SICM class at MIT…


    • At ANY COST. Just to see.

    View Slide

  41. 🤯

    View Slide

  42. View Slide

  43. View Slide

  44. View Slide

  45. View Slide

  46. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  47. View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. (Roam Tour)

    View Slide

  52. Roam is NOT good (yet) for
    Interactive, Scienti
    fi
    c Notes

    View Slide

  53. View Slide

  54. View Slide

  55. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  56. Philosophy of a Code Zettelkasten
    • Produce the composable, executable thing; DON’T cut its ties back into the graph!


    • True for components


    • Also true for “projects”, puzzles, games, essays, Katas.


    • Sharing, accretion and “Additive” development are the prime directives!


    • Roam comes with all the words :) I need a Mathematica-lite sort of standard library.

    View Slide

  57. View Slide

  58. View Slide

  59. SICMUtils
    • Generic core of extensible functions


    • Numerics + Symbolic arithmetic, and great renderers for the whole bunch.


    • Essays:


    • Functional Numerical Methods


    • Power Series, Power Serious


    • Automatic Di
    ff
    erentiation


    • Extensible Renderers

    View Slide

  60. View Slide

  61. View Slide

  62. NextJournal Embedding

    View Slide

  63. Maria.Cloud

    View Slide

  64. The Plan
    • WHAT is Literate Programming?


    • Why aren’t we all doing this?


    • The Philosophy of Tools


    • The Menu of Tools for Literate Programming


    • My Stake in All This


    • How to Take Smart Notes


    • The Dynamic Notebook

    View Slide

  65. What’s Next for Us?
    • Follow along at roadtoreality.substack.com


    • Hang out in #sicmutils on Clojurians Slack or Zulip


    • Write me ([email protected]) if this is exciting!


    • If you want to pair or work on anything in SICMUtils I’ll pair and teach.


    • The barrier to entry will drop once the SICMUtils Standard Library lives in more
    environments.

    View Slide

  66. Thanks!
    S
    a
    m Ritchie (@sritchie) London Clojuri
    a
    ns Meetup, J
    a
    nu
    a
    ry 2021
    roadtoreality.substack.com
    https://github.com/sponsors/sritchie

    View Slide