Literate programming: Two beefs with the classic version (2014)
akkartik.name
akkartik.name
It's not the fault of Haskell imports that literate programs put them first.
>These are systems that focus on generating beautifully typeset documentation without allowing the author to arbitrarily order code.
As CWEB does allow the author to arbitrarily order code.
There's also this statement:
>I speculate that nobody has actually read anybody else's literate programs in any sort of detail.
Which suggests you yourself have never read any literate programs in detail. Thankfully this statement is provably false as the MMIX Group at MUAS exist? = true so I can merely comment that buggy line out and read the second half of your argument without it being entirely invalidated.
The previous sentence was: "When I look around at the legacy of literate programming, systems to do so-called semi- or quasi-literate programming dominate." Semi- or quasi- being intended to distinguish with classic literate programming as in CWeb.
I usually try to go out of my way to assume that if someone misunderstands me it's a failure of my writing, but in this case my post is filled with Knuth's original CWeb programs. It didn't seem realistic that you missed them all, or that you thought I missed that CWeb permits reordering in spite of having read so many CWeb programs.
And then you make this new jab about me not having read any literate programs, in spite of me showing repeatedly in the article that I went all the way down the list at http://www-cs-faculty.stanford.edu/~uno/programs.html. Are you sure you read my post?
---
Thanks for the pointer to http://mmix.cs.hm.edu/local. Not immediately obvious that it cares about literate programming, but I'll take your word for it. I'd appreciate intros to anybody in that group with experience reading literate programs (email address in profile).
I'm not sure what LP implementations you have looked at it would have again helped any misunderstanding on my part if you had named said implementations that supposedly "dominate" the legacy of LP.
The jab was to point out how your argument returns false with such statements as "I speculate nobody as ever read a literate program in detail", and "(typeset) can't render inside just about any actual programming environment (editor or IDE) on this planet, and so we can't make changes to it while we work on the codebase" yet emacs exists and can render typeset in a split screen buffer. DrRacket also renders tex and any other typeset you want http://lists.racket-lang.org/users/archive/attachments/20120...
I still find your approach of interpreting my statements as strictly logical entities to be pointless at best. For the last bloody time, I know that literate programs operate on hunks that can be reordered. I still don't understand how you can think I don't know that after reading the post. Also, was it not obvious that "nobody" meant "nobody else"? And yes, of course I can't be sure that none of the six billion people on the planet has ever read a literate program. (Though if they did and they didn't say anything about it, and they didn't push back against people building crappy quasi-literate systems, are they not like the proverbial falling tree in the forest with nobody to hear it?) It's a rant, dammit. Do you know what that is? :) I'm pissed off at quasi-literate systems that keep people from realizing what Literate Programming can be, and I'm sorry that wasn't clear to you from my writing.
Are there any good example Babel programs you can recommend? I went looking and didn't find anything better/meatier than https://github.com/limist/literate-programming-examples. I'm still skeptical that any sort of typesetting system is of much benefit; if I have to render in a split screen that's one less window for me to open code in, most likely I'll be trying to get by just reading un-rendered code. I think code should be WYSIWYG, because the slightest rendering step is overhead at the scale programmers deal with text. If I had to constantly render λ out of \lambda I'd never use it. But now that my terminal can render unicode sanely I use it all the time. Racket's Scribble system suffers the same drawback (Racket's ability to render Latex that you pointed out is utterly irrelevant in the context of this thread, without Scribble's ability to reorder code).
Anyways, if you'd send me some example Babel programs I'd love to give it a try.
That's a very complicated question.
In a complex world, you have to do something to establish the context in which a particular piece of code is being evaluated. It's a matter of taste whether that context establishment should come before or after the code for which the context is being established. Personally, I prefer the context establishment to come before, but reasonable people can disagree. This extends even to the language level, where you have some languages (like the C family, and Lisp) where variable bindings always precede their usage, and others like ML and Haskell, where the bindings can come after they are used.
But what I was complaining about was specific to #includes, which use a very particular (and badly broken) mechanism to establish context, namely, textual inclusion. It was a horrible hack invented to appease a brain-damaged compiler which could only deal with one file at a time. In 1970 this was an understandable engineering trade-off. In 2016, not so much. The right way to fix it is to get rid of it and replace it with something less brain-damaged rather than layering more hacks on top of it (IMHO).
RIP incremental build times.
> Then make a precompiled header for include.h (gcc, clang, and even msvc can do this), which will vastly speed up compile times, and compensate for the overhead of including unnecessary headers in your code that doesn't need to include everything.
Speaking from experience, god no it doesn't. Those are the codebases where fixing a single typo may take an hour to fully rebuild a single build configuration. As the poor bastard charged with porting things and managing said build configurations, this means I either break the build from time to time, or have to wait overnight to have a full set of builds to test before checking anything in.
Just use ccache if build times are getting atrocious, then focus on getting link times down :)
As for link times: switch from bfd to gold. And maybe play with --incremental. I didn't - just switching to gold shaved minutes off my link times for free, and suddenly link times were no longer my build bottleneck :)
If we could work, and annotate, at the graph level we'd see far more literate programming.
With this in mind it doesn't matter that the overarching structure is much more complex. Translation unit you're analyzing is (or should) be mostly human-parsable in a linear fashion.
What I found eye-opening in this article is that it challenged my concept of well structured code file. I was like "what?! this is blasphemy!" from the very beginning but at the end I was like "huh, I finally understand why sometimes #define's feel better in the center of a file than they feel at the top"[1]. It's rare for a blog entry to stir me like this. :)
[1] amongst other things that came though my head
When I start on a new program in F#, I usually just start with one main function and keep typing straight on down. When I want to re-organize it into a module, it's usually nearly as easy as writing "module" at the top.
Without this, one is encouraged to either not abstract properly as the overhead and context for a new top-level function is too much, or you end up with free-floating functions that don't belong there and only have a single caller.
The first article from the most recent issue of the first journal listed on the AMS page is here: http://www.ams.org/journals/ecgd/2016-20-01/S1088-4173-2016-...
To me that looks like quite a bit of English, organized for humans. It is true that there are also quite a few symbols, but I contend it looks a whole lot more like the CWEB implementation of wc than it does like the C implementation.
http://unisonweb.org/ doesn't espouse the term"literate programming" itself, but its ideals are comparable. Oh, and, no imports whatsoever :).
"Literate Programming in the Large": https://www.youtube.com/watch?v=Av0PQDVTP4A
The reorganization is still ongoing, as can been seen at: http://www.axiom-developer.org/axiom-website/currentstate.ht...