Termtris: A Game Like Tetris in Ten Functions
github.com
github.com
Very cool.
The common use of the term these days (source interspersed with documentation, serving as both) leaves out one significant aspect of WEB, where you could do quite a bit of rearranging the file layout (with slightly-buffed-up C style macros, basically) so that the communicative structure dominated. Reading through the papers on it was interesting; I've not actually put together a project in it.
Here is the source file: https://github.com/jashkenas/coffeescript/blob/master/src/gr...
Here is a nicely rendered version of the same file: http://coffeescript.org/documentation/docs/grammar.html
Also see literate coffeescript, a mode that seamlessly integrates markdown. I'd give up vim for a environment that lets me embed images, embed SVG diagrams, use those SVG diagrams at compile time to generate code, etc.
I think that done correctly, this sort of concept has a lot of potential. Editor support is pretty necessary though, since without it editing that code would mess with your ascii-art formatting.
Specifically, I don't think I fully grok/agree with the utility of having a single file that is both a markdown file and a lua file through commenting. In the end, it means you are still greatly limited to the ordering semantics of the main language.
Which is not to say some folk won't do an amazing job writing a program. They clearly will. However, I think the macro approach of CWEB (or noweb, even) still has a lot of mileage that is overlooked nowdays.
Not that this is totally wrong, working around the limitations of Pascal/C is one reason for the way Knuth's literate programming style was developed. The way I see it, the more simpler style is pretty good for a well-documented program that needs to be maintained, less so for a narrative that is a bit less focused, documenting the way something was initially written ("Let's add another field to our wibble_wobble structure to make wonk-gibbling work properly").
THEN its well documented!
THEN its in one file - wtf?
Well done!
http://www.miketaylor.org.uk/tech/tt/
Not done in 10 functions though! C on Unix.
However, IOCCC entry in the same year: