Matt Rickard

Share this post

Literate Programming with LLMs

blog.matt-rickard.com

Discover more from Matt Rickard

Thoughts on engineering, startups, and AI.
Continue reading
Sign in

Literate Programming with LLMs

Jul 17, 2023
6
Share this post

Literate Programming with LLMs

blog.matt-rickard.com
2
Share

Literate programming is a paradigm first introduced by Donald Knuth that mixes natural language and machine code in the same file. Extending explanations from just comments to markdown and formatted text, graphs, and more. 

Jupyter Notebooks were a reimagining of literate programming for the data science world. Now, with LLM-assisted environments like OpenAI’s code interpreter, will we see another form?

The intermixed natural language is twofold — (1) it serves as future documentation and explanation, and (2) it helps the model reason through chain-of-thought.

The constraints of Jupyter Notebooks

  • Works best with interpreted languages by just sending the commands to a running REPL

  • Suffers from out-of-order execution (since the REPL is reused and the user may run cells in any order)

  • Hard to convert to production code that can run unassisted

  • Hard to test

  • Hard to version

LLMs solve some of these problems (but not all, yet). Some unordered thoughts:

  • LLMs potentially solve the notebook-to-production gap. They can extract, rewrite, and productionize code that would have lived in a notebook otherwise

  • They might be able to generate unit tests and other scaffolds for the code

  • They can run more complex build tasks in a language-agnostic way (compiled languages, etc.)

6
Share this post

Literate Programming with LLMs

blog.matt-rickard.com
2
Share
Previous
Next
2 Comments
Share this discussion

Literate Programming with LLMs

blog.matt-rickard.com
Rick Lamers
Writes Coding with Intelligence
Jul 18Liked by Matt Rickard

I think chat + REPL gets pretty close. I made this OSS version https://github.com/ricklamers/gpt-code-ui

Expand full comment
Reply
Share
Ankesh Bharti
Writes The Westworld Dream
Jul 17Liked by Matt Rickard

Worth checking out: https://www.askmarvin.ai/src/getting_started/what_is_marvin/

Expand full comment
Reply
Share
Top
New
Community

No posts

Ready for more?

© 2023 Matt Rickard
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing