Tango / Phobos / future dilemma
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Tue May 27 07:49:26 PDT 2008
Sascha Katzner wrote:
> I see no reason why those two IO systems couldn't coexist on top of a
> common low level cache.
(All of the statements below are AFAIK & IIRC from the newsgroup
discussions on this subject)
Walter seems convinced that using the libc buffering is the Right Thing
To Do(TM) because it allows intermixing of *printf(), putc*(), etc. with
writefln & friends without explicitly syncing them.
The Tango devs have a good reason to use their own, separate, buffering
solution: the tests showing better performance. (And many people
consider it bad style to use C-style I/O in D programs anyway, so "it's
just not worth it" becomes a good argument pretty quickly here)
This just doesn't allow a "common low level cache" since neither of
their buffering solutions allows the use of a common buffer unless the
other one switches (Phobos can't change libc while much of the Tango IO
functionality depends on using the custom buffer and its good
performance depends on interfacing directly to the OS)...
In other words, it's a fundamental disagreement about how to best do I/O.
 Also, changing the Tango I/O code to use libc instead of direct OS
calls isn't very helpful since it still won't be synced to C-style I/O
(there'll still be an extra buffer in front of the Tango stuff that
would only send stuff to libc when full or explicitly flushed).
More information about the Digitalmars-d-learn