Re: [Haskell-cafe] Fwd: Default stdout buffering of child process of createProcess

I still think haskell is using screwy defaults for stdout buffering.
Line buffered would be an inefficient default. Stdout is fully buffered in c99 if it can be determined that it is not attached to a terminal.
Putting efficiency before efficacy is un-Haskellian. How can the required determination be implemented? Stdout may be attached to a terminal indirectly through a pipeline. It may be "attached" through a file that another process is watching. It may be attached to some other real-time device or system. Buffering can cause unbounded delays in systems with sporadic input. And it can cause deadlock in systems that employ feedback, as most systems do. Terminals, for example, are unbuffered not merely because users are impatient, but more critically because users are feedback agents. Because the effects of buffering are not transparent, it would be wise to make it an optional optimization, not a default.

On Sun, Aug 3, 2014 at 10:39 AM, Doug McIlroy
Because the effects of buffering are not transparent, it would be wise to make it an optional optimization, not a default.
It's not just efficiency, it's also behaving compatibility with other implementations. Or were you going to argue this with e.g. the ANSI C committee too? -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Brandon Allbery:
On Sun, Aug 3, 2014 at 10:39 AM, Doug McIlroy
mailto:doug@cs.dartmouth.edu> wrote: Because the effects of buffering are not transparent, it would be wise to make it an optional optimization, not a default.
It's not just efficiency, it's also behaving compatibility with other implementations. Or were you going to argue this with e.g. the ANSI C committee too?
I admit that I didn't follow this thread, so I might have skipped something, but ... Is Brandon Albery suggesting that Haskell should progress in the direction that makes it as compatible as possible with ANSI C? Jerzy Karczmarczuk

On Sun, Aug 3, 2014 at 12:41 PM, Jerzy Karczmarczuk < jerzy.karczmarczuk@unicaen.fr> wrote:
I admit that I didn't follow this thread, so I might have skipped something, but ... Is Brandon Albery suggesting that Haskell should progress in the direction that makes it as compatible as possible with ANSI C?
Brandon Allbery is suggesting that things that promote interoperability are a good idea. I'm sorry you find this an unpalatable notion; perhaps Haskell should forcibly reject all conceivable real world usage in order to properly meet your expectations. (Note that this may well include the usage that spawned this sorry thread; presumably a desire for interaction between subprocesses is not because it's operating in a hermetically sealed compartment isolated from the rest of the world.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

I'm sorry you find this an unpalatable notion; perhaps Haskell should forcibly reject all conceivable real world usage in order to properly meet your expectations.
Take it down a notch, guys. We're usually very good at being a place where outsiders can be confident their (coherent) questions and ideas will be treated respectfully. If they can't be, many people with good ideas will stay silent or go elsewhere. Tom

I find the idea of buffering as an optional optimisation theoretically nice but practically, not so much. I am sick of having to tell students "Java does not buffer by default, it is up to YOU to use BufferedReader and/or BufferedWriter if you do not want I/O to be catastrophically slow".

On Sun, Aug 3, 2014 at 6:31 PM,
"Java does not buffer by default, it is up to YOU to use BufferedReader and/or BufferedWriter if you do not want I/O to be catastrophically slow".
Pretty much, yes. I'd forgotten that particular Java misfeature, particularly since everyone else who'd considered changing the default learned from the Java experience instead of repeating it. (Granted, Java is something of a pessimal case.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (5)
-
amindfv@gmail.com
-
Brandon Allbery
-
Doug McIlroy
-
Jerzy Karczmarczuk
-
ok@cs.otago.ac.nz