| Deutsch English Français Italiano |
|
<86y12uy8ku.fsf@linuxsc.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch <tr.17687@z991.linuxsc.com> Newsgroups: comp.arch Subject: Re: 80286 protected mode Date: Fri, 11 Oct 2024 08:15:29 -0700 Organization: A noiseless patient Spider Lines: 36 Message-ID: <86y12uy8ku.fsf@linuxsc.com> References: <2024Oct6.150415@mips.complang.tuwien.ac.at> <memo.20241006163428.19028W@jgd.cix.co.uk> <2024Oct7.093314@mips.complang.tuwien.ac.at> <7c8e5c75ce0f1e7c95ec3ae4bdbc9249@www.novabbs.org> <2024Oct8.092821@mips.complang.tuwien.ac.at> <ve5ek3$2jamt$1@dont-email.me> <be506ccef76d682d13205c69c761a086@www.novabbs.org> <ve6oiq$2pag3$1@dont-email.me> <ve6tv7$2q6d5$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 11 Oct 2024 17:15:29 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7c69fe22f3f04b1159714f26b61f0388"; logging-data="3886543"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18JIIi+1+gM2J2qsI2NPw+jVkDEydJ01m4=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:YqVkSUnlGsY3liXAUepOtM/Te18= sha1:JMq+F8RY1iwAVvWgQxtm+JTjrbE= Bytes: 3161 Stephen Fuld <sfuld@alumni.cmu.edu.invalid> writes: > On 10/9/2024 1:20 PM, David Brown wrote: > >> There are lots of parts of the standard C library that cannot be >> written completely in portable standard C. (How would you write >> a function that handles files? You need non-portable OS calls.) >> That's why these things are in the standard library in the first >> place. > > I agree with everything you say up until the last sentence. There > are several languages, mostly older ones like Fortran and COBOL, > where the file handling/I/O are defined portably within the > language proper, not in a separate library. It just moves the > non-portable stuff from the library writer (as in C) to the > compiler writer (as in Fortran, COBOL, etc.) What I think you mean is that I/O and file handling are defined as part of the language rather than being written in the language. Assuming that's true, what you're saying is not at odds with what David said. I/O and so forth cannot be written in unaugmented standard C without changing the language. Given the language as it is, these things must be put in the standard library, because they cannot be provided in the existing language. There is an advantage to the C approach of separating out some facilities and supplying them only in the standard library. In particular, it makes for a very clean distinction between two kinds of implementation, what the C standard calls a freestanding implementation (which excludes most of the library) and a hosted implementation (which includes the whole library). This facility is what allows C to run easily on very small processors, because there is no overhead for non-essential language features. That is not to say such things couldn't be arranged for Fortran or COBOL, but it would be harder, because those languages are not designed to be separable.