Salta al contenuto

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone
  • 0 Votazioni
    1 Post
    0 Visualizzazioni
    Hey, look what unexpected context I found #LiterateProgramming to be used in!https://www.cs.tufts.edu/~nr/toolkit/specs/sparc.html
  • @oblomov

    Mondo literateprogramming
    25
    0 Votazioni
    25 Post
    0 Visualizzazioni
    @oblomov The basic idea here is actually really trivial:the parser needs to be able to ignore a #! ... line if the web should start with one, andthere needs to be a tool, or a tangler mode, that, instead of generating the file(s) to become static nodes in the filesystem, tangles a script and feeds it directly into a specified interpreter's stdin, or possibly a numbered preopened file, or possibly, in some cases, tangles a bunch of files into a temporary 'sandbox' directory, runs a specified interpreter on one of them, and cleans up when the interpreter is done.All in all, about 30 lines of Ruby code. Perhaps a bit more if you want to weave the #! ... line somewhat fancy (I've generally ignored it by default, or optionally allowed it to be formatted as a 'directive', just without most of the accoutrements that other directives get).Things can be a little messier on Windows, but basically boil down to defining a 'filename extension' that would be associated with this 'execute-in-place' semantics of a web. On very old versions of Windows, one might need to resort to there being a dedicated bat file to explicitly run the tangling tool and point at its web source. But the sort of people who still run old versions of Windows are used to such kludges, and/or possibly doing something REXXy (if coming from OS/2), anyway. Yay #retrocomputing! Potentially, one could use the FreeDOS shell, or 4DOS, and hack in some %PATHEXT% semantics, for an example.
  • 0 Votazioni
    3 Post
    30 Visualizzazioni
    @sigue It requires minimal tooling.
  • What a curious point about LP:

    Mondo literateprogramming
    2
    0 Votazioni
    2 Post
    8 Visualizzazioni
    @riley can confirm, it's why I wrote my own AsciiDoctor extension for Literate Programming.https://github.com/Oblomov/asciidoctor-litprog