The Birth of Standard Error (2013)
www2.dmst.aueb.gr
www2.dmst.aueb.gr
He's got some pretty neat stuff in there!
This is awesome
As far as I can remember, Wainer doesn't really assert that the equation is known as "de Moivre's equation", that's just what he calls it in the context of his article.
I think just out/err has been proven by history but that couldn't have been obvious to the original designers?
So you could write a log file with separate streams for different verbosity levels.
At a first glance, named pipes (both the Unix and the Windows approach) sound like that, but they are global names - i can't have an application exposing a "commands" output stream that from the shell is piped to awk which is then piped to a "monitor" input stream of another application - and then have arbitrary number of instances of those.
You can ducktape a solution using randomly created unique global names and some shell script code, but what i think would be nice is something like:
/* app1 */
FILE* commands = stream("commands", "w"); /* write-only stream */
/* app2 */
FILE* terminal = stream("terminal", "r"); /* read-only stream */
that could be used via something like (:foo would be used wherever a file descriptor could be used to specify stream foo) # redirect commands stream from app1 to terminal stream of app2
app1 :commands>&:terminal app2
# redirect commands stream from app1 to stdout
# (stdin of the right side which is empty, hence stdout)
app1 :commands>&0
# pipe commands to awk's stdin then grep then app2's terminal stream
# regular app1 stdout is not affected and written wherever stdout is
app1 :commands| awk blah | grep bleh 1>&:terminal | app2
the shell syntax would also need to be extended a bit to allow for parallel pipelines (e.g. app1 could also export a "comments" stream that could be piped to a separate file or to a projector application).Common Lisp standardises a whole bunch of different streams (their names begin & end with asterisks, but I don't think that there's a way for HN to escape those):
- standard-input: probably what you think it is
- standard-output: ditto
- error-output: what a Unix user might call standard-error …
- query-io: a bidirectional stream, used for questions & answers asked of the user interactively
- debug-io: another bidirectional stream, used for debugging
- trace-output: used for print function traces & timing information
- terminal-io: a bidirectional stream representing the terminal itself
Yeah, like a lot of Common Lisp it's overengineered, but there are some intriguing possibilities in there, too.
Similar thing happens with ZPL/EPL printers as well; I've troubleshot many a workstation where someone expected a shipping label and instead got a long string of "^XA^PW812 [...] ^XZ" across dozens of labels.
- IBM JCL has DD statements for SYSERR, SYSIN, and SYSOUT, but I can't find the date that SYSERR was introduced.
- Any old Fortran IV programmers know that I/O unit 0 is STDERR, unit 5 is STDIN, and unit 6 is STDOUT. And Fortran IV is from 1966 (aka "Fortran 66").
However, I found a 1970 manual for Fortran IV, and at that time, unit 0 was illegal (see table 123-3 on page 13-4), so unit 0 must have been added later, adding token support for the claim made in this article.
http://www.bitsavers.org/www.computer.museum.uq.edu.au/pdf/D...
I don't remember the Fortran 77 standard specifying STDERR, STOUT or STDIN in the sense the the C and C++ Standards do (in lower case) - but I might be a bit forgetful; this was over 30 years ago.
In Version 7 (1979), it moved to the kernel - see setregs() in https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/sys/sys...
The V7 kernel model makes it generic - on exec, Unix will close() any file that has the close_on_exec flag set.
I believe that is the critical concept - stderr is supported by an OS level feature and inherits across various processes through pipes, forks and execs.
To tie back to the initial case in this thread, this is very useful for the Unix print system because it was/is a maze of squirrelly processes.
The Great 202 Jailbreak - Computerphile