We noticed today when running a swift CLI program to a pipe that stdout is fully buffered (e.g. not unbuffered, not line-buffered). So just now we committed unbuffering IO to a bunch of CLI programs.
Is this the right default behavior for Swift?
I realize this is a Cism with a long history, but I think an argument can be made that the Cism is surprising (in that: it surprised us). I think most Swift developers would assume "print" to be line-buffered.
Requiring programs to opt-in to linebuffering so they can work via pipe feels wrong to me. Am I crazy?
On Apr 1, 2016, at 2:52 PM, Drew Crawford via swift-dev <swift-dev@swift.org> wrote:
We noticed today when running a swift CLI program to a pipe that stdout is fully buffered (e.g. not unbuffered, not line-buffered). So just now we committed unbuffering IO to a bunch of CLI programs.
Is this the right default behavior for Swift?
I realize this is a Cism with a long history, but I think an argument can be made that the Cism is surprising (in that: it surprised us). I think most Swift developers would assume "print" to be line-buffered.
Requiring programs to opt-in to linebuffering so they can work via pipe feels wrong to me. Am I crazy?