• Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    1 day ago

    I’m a bit confused here. I’ve used literate programming a lot, and used cweave and ctangle to create C and TeX sources from a single source file. Any iteration is done on the single original source, never on the intermediate C or TeX sources. Where does OP get into dissosiations between code source and document source?

    • thenextguy@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      I see this as the same problem where comments are not updated when code is and no longer match. I think he’s still talking about a single file here.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      When you make changes to the comments or pseudo code to maintain the program, then you also need to do the same changes to the actual source code the compiler will use. As the human language comments need to be compiled to C by human, right? And this would end up thinking and maintaining the source code of two languages and hope they always align in their logic.

      I never did this approach and only get this from reading the blog post.

      • Treczoks@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

        The very idea of weave and tangle is that comment and code is (nearly) one. Just updating one makes no sense.

        TeX and MetaFont are written in such a system, and you can read the TeX’ed source like a book.

      • madnificent@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

        The way I’ve used it is more that the text gives an explanation and a structure regardless of what the framework requires. It’s not the exact algorithm per se but it could if it’d ver very complex for some reason. It ends up reading like a book with code snippets in it which turns out to run the application.

        I also generally edited the code directly and indirectly and then detangled or tangled such that the files were in sync.