Skip to content
Tony Fast edited this page Jan 30, 2024 · 2 revisions

midgy converts markdown to executable python and more. it is the basis for a literate programming metalanguage with markdown as the document language and python as the programming language. a lot of code is contained in markdown, but never gets executed. why not?

midgy was developed to:

  1. have more fun writing markdown
  2. develop a tighter relationship between markdown and code than notebook cells
  3. explore the best heuristics to synthesize python from markdown
  4. give reasonable error messages
  5. improve the writing experience in notebooks

have more fun writing markdown

My hope is that the ability to make explanations more natural will cause more programmers to discover the joys of literate programming, because I believe it’s quite a pleasure to combine verbal and mathematical skills; but perhaps I’m hoping for too much.

literate programming - donald knuth

markdown has seen remarkable adoption through social coding platforms. knowledge of markdown is a modern literacy to contribute to most plain text editors. the pervasive adoption and general inclusion of all programming languages makes it a great glue language for scientific and data driven literate programs.

tighter relationship of markdown and code

computational notebooks are one of the most popular file forms for literate programs. most implementations draw strict block level separation between code and narrative. midgy allows markdown to used in python and python used in markdown throughout the lifecycle of the tangle and weave phases of literate programming. this bi-directional coupling allows for novel programs and interactions to be created. the density of midgy proves specifically ideal for presentations where blocks of markdown represent the execution and display of markdown source. this co-development is also strong early in research because that act is literally turns words into code.

improving the writing experience

There is, finally between science and literature, a third margin which science must reconquer, that of pleasure.

science vs literature - roland barthes

flow in writing is so important. when we are write literate programs we context switch between code and narrative. markdown naturally brings code and narrative nearer. authors can seamlessly switch between both contexts putting more characters on the page.

Clone this wiki locally