I admire your willingness to be corrected, and feel under pressure to be accurate. That's not a bad thing. What am I trying to do? My thoughts have been influenced the other recent thread on cooperation, in which the OP didn't realise how different from each other operating systems might be. Because of that, I'm arguing against your statement, "From the point of view of a C application programmer, PDOS is no different from any other system." I'm using standard IO and printf as examples of things which differ. I think it would be better to say, "PDOS offers full C90 support," or "PDOS offers full support for standard C90." Something like that.kerravon wrote:Exactly.eekee wrote:I'm glad you found it interesting. I suppose my explanation doesn't change anything. A hypothetical C implemetation on an Atari 800 could do just as BASIC did.
I don't mind you doing that. I'd like to know if I'm not using the correct terminology or whatever. So if I've said something slightly wrong, please let me know.I could continue to argue the point, but honestly, it would be nitpicking your wording
I was thinking of the two together, especially thinking of your C library as part of your OS.kerravon wrote:Did you mean my C library?rather than saying anything interesting about your OS.
I tried to use GUI OSs as additional examples of systems where printf may not make sense. I should have started with them as they're the strongest example.kerravon wrote:Are you classifying PDOS/386 as a GUI OS, or the Atari 800?In a pedantic sense, a GUI OS
Examples of systems which have an odd way to conform to the standard are interesting, but not really my point. My point is that there have been real OSs whose principles of operation so conflict with certain things in the C standard that the standard has to give way. Standard I/O is one of those things. It was very much against the principles of GUI OSs in the 80s & 90s. I've just grepped through the source (that I have) of one such GUI, OpenGEM, and found no instances of printf which made into an executable program. There are many instances of sprintf and [v]fprintf, but only 1 printf. It's in a tiny program; nothing more than a wrapper around strtok(), and it hasn't been compiled for distribution. It's not in the makefile. Perhaps the only reason it was even written in that way was that GEM runs on top of DOS and thus, when a program runs in DOS mode, standard output is available. No GEM program would use printf even though C is the language of much of GEM's source.kerravon wrote:The programmer shouldn't have to do either of those things to display "hello world". printf is expected to do something sensible on that environment. When run in MVS batch, the printf output goes to the JES2 spool where it may be purged without ever being read, or printed out onto real paper, etc.without a logging facility may have no all-purpose output for printf to use, but that is hardly interesting when programs under such an OS can use snprintf to create a string to display or fprintf to write to a file.
Would an OS implementor today choose to do without standard IO? Perhaps. Chuck Moore, "discoverer" of Forth, was able to make colorForth's interpreter considerably simpler than standard Forths in part by having it read keys directly. Dealing with arbitrary-length input lines coming from a pipe created complexity. There could be all sorts of arguments over whether such changes and standards-defiance are worthwhile, but the point is strange operating systems exist. They have been popular IRL. Mac OS was one of them prior to the release of OS X, and I'm almost 100% sure it didn't have any form of standard output at all. GEM was in the ROM of the Atari ST, and the ST's niches in Germany, CAD and desktop publishing, surely included much software written in C. Now I think about it, I'm not even sure Microsoft Windows programs have anywhere to send standard output if they're not the sort of program which wants a console open. (Windows can tell from the binary, somehow.)