This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: Linux vs. libio
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: Linux vs. libio
- From: Per Bothner <per at bothner dot com>
- Date: 20 Dec 1999 11:28:05 -0800
- Cc: gcc at gcc dot gnu dot org, libc-alpha at sourceware dot cygnus dot com
- References: <199912201906.TAA05714@phal.cygnus.co.uk>
Joern Rennecke <amylaar@cygnus.co.uk> writes:
> C++ was known to be volatile when libio was written.
> The compatibility issues we have now could have been avoided if the API
> of libio had been designed to use plain C.
Duh. libio defines some *C++* classes, whose specification
was (partially) specified by existing (de facto) standards.
Using plain C misses the point. Libio was written to facilitate
integration of C and C++ I/O, which is *required* by the C++ standard.
There is (as always) a design tradeoff. As I see it,
unified C/C++ I/O gives us:
+ Improved performance.
+ Conceptual elegance of uniting the I/O facilities of C/C++.
+ Easier mixing of C and C++ code (a GNU extension).
+ Sharing some tricky code (e.g. buffer management).
On the other hand, it costs us:
- Extra "hair".
- Compatibility issues made more complicated when two ABIs
depend so closely on each other.
One can rationally argue for or against the unification.
An argument can be made that unification is "doing the right
thing" and well within the Gnu tradition of sacrificing
implementation complication for better performance or functionality.
What gets really annoying when C programmers make judgemental
statements without understanding the issues.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/