4 ms·
Cool beans. The literate coding system they're using (Unu) is a bit primitive, but it's GREAT that they're using one at all.
by retrocryptid 3y ago
Cool beans. The literate coding system they're using (Unu) is a bit primitive, but it's GREAT that they're using one at all.
- zimpenfish 3y ago> The literate coding system they're using We need a new name for this kind of thing[1] because it's not really literate programming - you can't re-order your code blocks in the literate source files and have them come out in the right place in the code source files which is, I think, a key part of it being literate programming. Don't get me wrong - I use this a lot with the various *occos - but it needs a name of its own. [1] Assuming we don't already have one that I've missed.
- dllthomas 3y agoSadly, I think the new name for this kind of thing has been "literate programming" for the past 20 years at least, while the literate programming that Knuth described has been renamed something like "the literate programming that Knuth described".
- mananaysiempre 3y agoI think Docco was when that approach acquired some kind of popularity? So 2010 or so[1]. Of course Haskell has had its “literate format” since forever (ETA: the Haskell 1.2 report[2], dated March 1992, has a description in an appendix), and it became mildly popular for Haskell blogging when blogs caught on, but its name was always accompanied by a side note that in Haskell you don’t really need to reorder things (kind of true). [1] https://github.com/jashkenas/docco/commit/9b666b77c476fd76b9a22d2a9f69c4b683829119 https://github.com/jashkenas/docco/commit/9b666b77c476fd76b9... [2] http://haskell.org/definition/haskell-report-1.2.ps.gz http://haskell.org/definition/haskell-report-1.2.ps.gz
- dllthomas 3y agoI recall, on first encountering Literate Haskell at some point after 2010, mentally comparing it to something I thought I recalled from earlier in the perl ecosystem (on top of being vaguely aware of Knuth's stuff, although I hadn't actually read up on it at that point - at this point I have a copy on my desk).
- mananaysiempre 3y agoPOD? I’ve only encountered people using it to embed manpages into their single-file scripts, even if it turns out that the documentation[1] doesn’t consider this the canonical use case and demonstrates something much more like LH. But then I’ve never done much Perl. [1] https://perldoc.perl.org/perlsyn#PODs:-Embedded-Documentation https://perldoc.perl.org/perlsyn#PODs:-Embedded-Documentatio...
- dllthomas 3y agoI don't think it would have been POD (which I agree isn't the same thing) but maybe. It's been a while.
- WorldMaker 3y agoIt's in the interesting overlap space with Notebooks. I don't know if that is a name you'd want to reuse for "non-reorderable literate programming", especially as more Notebooks move the other direction and support cell reordering.
- crc_ 3y agoI'd love to have a better name for this, and am quite willing to change my description of it when I find one.
- d4rti 3y agoSemi-literate programming?
- wolfgang42 3y agoMy take on this is that TANGLE-style reordering is much less necessary now that we have ubiquitous forward referencing and variables that can be declared in the middle of a function. If you read Knuth’s Pearls example[1], a lot of the code blocks would be separate constants or functions; but he’s using WEB to inline them to compensate for the one-pass compiler and associated limitations. In a modern language for the most part you already have the freedom to order your code blocks however you want, and you don’t need a separate tool to make this possible. At that point the main advantage that the technique offers is particularly extensive and well-formatted comments. McIlroy also touches on this in his review, though from the other direction: > Perhaps the greatest strength of WEB is that it allows almost any sensible order of presentation. Even if you did not intend to include any documentation, and even if you had an ordinary cross-referencer at your disposal, it would make sense to program in WEB simply to circumvent the unnatural order forced by the syntax of Pascal. [1] Of “Knuth v McIlroy” fame: https://homepages.cwi.nl/~storm/teaching/reader/BentleyEtAl86.pdf https://homepages.cwi.nl/~storm/teaching/reader/BentleyEtAl8...
- remexre 3y agoForth dialects typically don't have forward referencing _or_ variables that can be defined in the middle of a function, though! (Though, writing a function long enough that you might want to declare a variable part-way through it would probably be a code smell in Forth...)
- wolfgang42 3y agoI was vaguely under the impression that Forth only dereferenced words from the dictionary into functions when you call them, but I admit I haven’t actually used it. In that case, being able to reorder your code so you can give the overview of what you’re trying to do before diving into the finer details of its internals does seem like a great help!
- mananaysiempre 3y ago> The literate coding system they're using (Unu) is a bit primitive, but it's GREAT that they're using one at all. There’s an old tradition of annotating Forth code with documentation: code would go into even-numbered 64x16-character “blocks”, accompanying documentation into odd-numbered “shadow blocks”, and on e.g. a VGA you could even view them at the same time.