RE: Haskell 98: Behaviour of hClose
What I intended was a simple interactive Haskell program should behave the same on any OS/environment What you and Ross seem to be saying is no, the behaviour of the program can, and should, depend on the OS/environment If that's the consensus I'll happily leave echoing behaviour unspecified. Remember, that means that a conforming implementation can do whatever it pleases, and hence it's impossible to write a portable interactive Haskell program. Is that you what you intend? It's really a pain that this has come up so late in the day. Simon | -----Original Message----- | From: Ferenc Wagner [mailto:wferi@bolyai1.elte.hu] | Sent: 18 September 2002 11:50 | To: haskell@haskell.org | Subject: Re: Haskell 98: Behaviour of hClose | | Ross Paterson <ross@soi.city.ac.uk> writes: | | > So I favour deletion of the offending sentence, leaving | > this as an environment-dependency. | | I second that. I came to Haskell after many other | programming languages, and was VERY surprised by echo | behaviour. I vote for consistency with long-standing | standards (C library, every other language) and versatility | (echo and buffering determined by environment -- it should | be configured to also run non-Haskell programs, after all). | | Feri. | _______________________________________________ | Haskell mailing list | Haskell@haskell.org | http://www.haskell.org/mailman/listinfo/haskell
"Simon Peyton-Jones" <simonpj@microsoft.com> writes:
What I intended was a simple interactive Haskell program should behave the same on any OS/environment
What you and Ross seem to be saying is no, the behaviour of the program can, and should, depend on the OS/environment
If that's the consensus I'll happily leave echoing behaviour unspecified. Remember, that means that a conforming implementation can do whatever it pleases, and hence it's impossible to write a portable interactive Haskell program. Is that you what you intend?
How about amending your proposed insertion to say: If the standard input (stdin) is a terminal device, any input on stdin is normally echoed on that device, unless the OS/environment settings indicate otherwise. In other words, echoing is the natural expectation, but any external controlling influence (terminal device, terminal driver, OS, environment) should take precedence, since (a) it is explicit control by the user, and (b) there is no way to achieve the same control internal to a Haskell'98 program. Regards, Malcolm
"Simon Peyton-Jones" <simonpj@microsoft.com> writes:
If that's the consensus I'll happily leave echoing behaviour unspecified. Remember, that means that a conforming implementation can do whatever it pleases, and hence it's impossible to write a portable interactive Haskell program. Is that you what you intend?
The Report should not let an implementation do whatever it pleases. But it could specify that the runtime system *does not mess* with the terminal settings, so users' preferences prevail. For buffering, the recipe is: terminals are line buffered, everything else is block buffered. I find this appropriate for most applications, except some close (one keypress) interactions, which are done better via specialised libraries anyway. (I have to admit I'm from the Unix world. Other perspectives are surely possible.) Feri.
On Wed, 18 Sep 2002, Simon Peyton-Jones wrote:
What I intended was a simple interactive Haskell program should behave the same on any OS/environment
What you and Ross seem to be saying is no, the behaviour of the program can, and should, depend on the OS/environment
If that's the consensus I'll happily leave echoing behaviour unspecified. Remember, that means that a conforming implementation can do whatever it pleases, and hence it's impossible to write a portable interactive Haskell program. Is that you what you intend?
This is probably a non-issue. If you start trying to specify details like echoing, you might as well go into the details of which pixels are supposed to light up on the monitor, or how the teletype should behave. If you indicate leeway then implementors will probably "do the right thing" in all or nearly all cases. Note that the Report does not (really cannot) precisely specify what happens when multiple programs access the same file at once, or what happens when a program receives a SIGHUP signal (because its controlling terminal has disconnected) or all sorts of other things that are not really any of its business. David
Simon Peyton-Jones wrote:
What I intended was a simple interactive Haskell program should behave the same on any OS/environment
What you and Ross seem to be saying is no, the behaviour of the program can, and should, depend on the OS/environment
If that's the consensus I'll happily leave echoing behaviour unspecified. Remember, that means that a conforming implementation can do whatever it pleases, and hence it's impossible to write a portable interactive Haskell program. Is that you what you intend?
The behaviour of the program itself doesn't depend upon the environment, but the overall user-visible behaviour of the system when running that program does. Any echoing, line editing, etc which is performed by the OS' terminal driver is not part of the program's behaviour. A conforming implementation should *not* do whatever it pleases. If necessary, it should be explictly specified that the terminal settings are left untouched. -- Glynn Clements <glynn.clements@virgin.net>
participants (5)
-
David Feuer -
Ferenc Wagner -
Glynn Clements -
Malcolm Wallace -
Simon Peyton-Jones