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 full-size 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 full-size 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 full-size 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 full-size slide

  5. 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 full-size slide

  6. 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 full-size slide

  7. ~Doug McIlroy

    View full-size slide

  8. Power Series, Power Serious

    View full-size slide

  9. 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 full-size slide

  10. We SORT of are…

    View full-size slide

  11. 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 full-size slide

  12. 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 full-size slide

  13. The Philosophy of Tools
    PRESENTATION vs Discovery


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

    View full-size slide

  14. 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 full-size slide

  15. Query Optimizer

    View full-size slide

  16. th.ing Geometry

    View full-size slide

  17. 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 full-size slide

  18. 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 full-size slide

  19. 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 full-size 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 full-size slide

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

    View full-size slide

  22. 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 full-size slide

  23. 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 full-size slide

  24. 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 full-size slide

  25. NextJournal Embedding

    View full-size slide

  26. 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 full-size slide

  27. 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 full-size slide

  28. 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 full-size slide