This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linux vs. libio


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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]