When teaching #rust, I often see people have a "Wow 🤯!" experience when I show #rustdoc #doctest system: you write small pieces of Rust code in your documentation and they are then executed as part of your test suite.

What people often don't know is that this system is ancient! I first met in #python and there it was introduced in 1999: https://groups.google.com/g/comp.lang.python/c/DfzH5Nrt05E/m/Yyd3s7fPVxwJ. That's 24 years ago!

I don't know if this was the first implementation of this concept?

I always thought that doctests were an evolution of literate programming pioneered by Donald Knuth. However, reading https://en.wikipedia.org/wiki/Literate_programming again, I now see that it's explicitly called out that literate programming is about the ability to form a program from a web of smaller pieces. Importantly, this web does not have to follow the structure of the finished program.

I have not actually tried to do #literate #programming — is there anybody here who have experience with it?

Literate programming - Wikipedia

@mgeisler notebooks are example of literate programming. Cells are the small pieces of code given with explanation. Maple and Sage are other examples of literate programming . And the document with that snippets, run the full workflow required.
I think in literate programming as a form of programming which docs are the main part or a type of docs driven methodology to enforce documentation over logic. Because explanation, also modularity is enforced to explain small pieces of code.
@cosmoscalibur Yeah, good point about using notebooks such as #Jupyter. This might be the closest modern tool in this tradition.