Live data from Hacker News

The most surprising Unix programs

minnie.tuhs.org

21–30 of 182 posts

Re: The most surprising Unix programs

#21

What's surprising about eqn, dc, and egrep? I'm using the latter two all the time, and have used eqn (+troff/groff and even tbl and pic) in the 1990's for manuals and as late as (early) 2000's to typeset math-heavy course material. Not nearly as feature-rich as TeX/LaTeX, but much more approachable for casual math, with DSLs for typesetting equations, tables, and diagrams/graphs. I was delighted to see that GNU had a…

I had never heard of eqn and was surprised to find that the binary is still there on my Linux box. With regard to roff in general, when I got into Linux-based typesetting around the turn of the millennium, that was already seen as antiquated tech, superseded by LaTeX which was undergoing a frenzy of development and improvement around that time. So, anyone under the age of 30 will probably be hearing of such *roff stu…

Ok I'm probably showing my age here then :) Back in the 1980 and 1990s, the roff suite, and most definitely egrep and classic Thompson DFA construction and DFA->NFA conversion was definitely Unix folklore/taught in Uni. Manpages are still rendered using roff/groff today, so probably many of us are using it regularly. Whereas GNU's texinfo has matured less well I'd say, or wasn't even very useful in practice to begin with due to lack of content.

I'm also using TeX/LaTex, but it's still a programming language whereas roff/eqn etc are non-Turing DSLs and renderers for particular narrow purposes. I get your point, but saying these are "antiquated" is like saying HTML is obsoleted by JavaScript.

Re: The most surprising Unix programs

#22

Earlier quoted context omitted.

I had never heard of eqn and was surprised to find that the binary is still there on my Linux box. With regard to roff in general, when I got into Linux-based typesetting around the turn of the millennium, that was already seen as antiquated tech, superseded by LaTeX which was undergoing a frenzy of development and improvement around that time. So, anyone under the age of 30 will probably be hearing of such *roff stu…

Ok I'm probably showing my age here then :) Back in the 1980 and 1990s, the roff suite, and most definitely egrep and classic Thompson DFA construction and DFA->NFA conversion was definitely Unix folklore/taught in Uni. Manpages are still rendered using roff/groff today, so probably many of us are using it regularly. Whereas GNU's texinfo has matured less well I'd say, or wasn't even very useful in practice to begin…

> Thompson DFA construction and DFA->NFA conversion

My (very recent) university education was unfortunately quite light on UNIX folklore, but this was converted in our formal automata course as we traversed the Chomsky hierarchy.

Re: The most surprising Unix programs

#23

> Originators of nearly half the list--pascal, struct, parts, eqn--were women, well beyond women's demographic share of computer science. When part of the joy of a place is that gender doesn’t matter, it’s hard to write about that joy, because calling attention to gender is the opposite of that.

Gender doesn't matter, as long as you're male.

Re: The most surprising Unix programs

#24
« Typo was as surprising inside as it was outside. Its similarity measure was based on trigram frequencies, which it counted in a 26x26x26 array. The small memory, which had barely room enough for 1-byte counters, spurred a scheme for squeezing large numbers into small counters. To avoid overflow, counters were updated probabilistically to maintain an estimate of the logarithm of the count. »

This sounds like something from the same family as hyperloglog

Wikipedia traces that back to the Flajolet–Martin algorithm in 1984. When would typo have been written?

Re: The most surprising Unix programs

#25

And people say theoretical computer science isn’t useful in “the real world”… I am curious about this one, though, has anyone used it? > The syntax diagnostics from the compiler made by Sue Graham's group at Berkeley were the mmost helpful I have ever seen--and they were generated automatically. At a syntax error the compiler would suggest a token that could be inserted that would allow parsing to proceed further. No…

> On the surface it sounds a lot like it would produce error messages like “expected ‘;’” that most beginner programmers come to hate Do people really come to hate these? I'd expect the opposite -- that people would start off hating messages like "expected ';'", but fairly quickly become accustomed to what they almost always mean. As long as you can look at the message and have a good idea of what's wrong, it's not a…

Elm has syntax errors stylized in this manner, but I am not sure how much is only rephrasing of usual "expected" or something more elaborate

Re: The most surprising Unix programs

#26
> Hidden inside WWB (writer's workbench), Lorinda Cherry's Parts annotated English text with parts of speech, based on only a smidgen of English vocabulary, orthography, and grammar.

Writer's Workbench was indeed a marvel of 1970's limited-space engineering. You can see it for yourself [1]: the generic part-of-speech rules are in end.l, the exceptions in edict.c and ydict.c, and the part-of-speech disambiguator in pscan.c. Such compact, rule-based NLP has fallen out of favor these days but (shameless plug alert!) Writer's Workbench inspired my 2018 IOCCC entry that highlights passive constructions in English texts [2].

[1] https://github.com/dspinellis/unix-history-repo/tree/BSD-4_1...

[2] https://ioccc.org/2018/ciura/hint.html

Re: The most surprising Unix programs

#27
post #4
post #3

> struct - Brenda Baker undertook her Fortan-to-Ratfor converter against the advice of her department head--me. I thought it would likely produce an ad hoc reordering of the orginal, freed of statement numbers, but otherwise no more readable than a properly indented Fortran program. Brenda proved me wrong. She discovered that every Fortran program has a canonically structured form. Programmers preferred the canonical…

I had to look up ‘Ratfor’ because I’d never heard of it — apparently it’s a FORTRAN preprocessor that added control structures.

https://en.wikipedia.org/wiki/Ratfor

The original Ratfor brings FORTRAN 66 nearly up to the level of a respectable programming language.

It turns this:

    if (a > b) {
      max = a
    } else {
      max = b
    }
Into this:

      IF(.NOT.(A.GT.B))GOTO 1
      MAX = A
      GOTO 2
    1 CONTINUE
      MAX = B
    2 CONTINUE
... with proper columnization, of course.

Going the opposite direction is pretty miraculous to me.

Ratfiv is the follow-on, which did the same to FORTRAN 77. However, FORTRAN 77 had control structures beyond the conditional GOTO, so Ratfiv was somewhat less necessary.

FORTRAN 77 would look like this:

      IF (A .GT. B) THEN
        MAX = A
      ELSE
        MAX = B
      ENDIF
https://en.wikipedia.org/wiki/Ratfiv

Re: The most surprising Unix programs

#28
post #24

« Typo was as surprising inside as it was outside. Its similarity measure was based on trigram frequencies, which it counted in a 26x26x26 array. The small memory, which had barely room enough for 1-byte counters, spurred a scheme for squeezing large numbers into small counters. To avoid overflow, counters were updated probabilistically to maintain an estimate of the logarithm of the count. » This sounds like somethi…

I believe that the paper backing the tool came out in the 70s, but if I ask IEEE for it it gives me back an awful PDF of one page that constrains a poor scan of the cover page of the paper and nothing else so I can’t confirm whether this idea was in it. Perhaps you might find more success: https://ieeexplore.ieee.org/abstract/document/6593963

Re: The most surprising Unix programs

#29
I didn't knew about typo. One surprising unix program I discovered this year is cal (or ncal). Having a calendar in your terminal is sometimes useful and I wish I knew earlier I could type things like ncal -w 2020

Re: The most surprising Unix programs

#30

Earlier quoted context omitted.

I had never heard of eqn and was surprised to find that the binary is still there on my Linux box. With regard to roff in general, when I got into Linux-based typesetting around the turn of the millennium, that was already seen as antiquated tech, superseded by LaTeX which was undergoing a frenzy of development and improvement around that time. So, anyone under the age of 30 will probably be hearing of such *roff stu…

Ok I'm probably showing my age here then :) Back in the 1980 and 1990s, the roff suite, and most definitely egrep and classic Thompson DFA construction and DFA->NFA conversion was definitely Unix folklore/taught in Uni. Manpages are still rendered using roff/groff today, so probably many of us are using it regularly. Whereas GNU's texinfo has matured less well I'd say, or wasn't even very useful in practice to begin…

> Manpages are still rendered using roff/groff today, so probably many of us are using it regularly.

I know a number of projects that generate their roff by using pandoc. They don't actually know, or have the inclination to learn, exactly how g/roff works.

Post reply on HN