Andrei Alexandrescu wrote:
Denis Koroskin wrote:
Well put, thank you. Everyone finds this situation annoying. That's
the Number One problem of the D (remember "top five" poll?).
The problem as I see it is that there is an overlapping functionality
in Phobos and Tango (std.stream.Stream/tango.io.Conduit etc).
The solution as I see it to redesign Phobos and Tango by removing dead
(buggy, unsupported) code, separating libraries functionality and
removing duplication.
I'd remove from Phobos:
std.
openrj
bigint (old one, by Janice)
regexp
socket
xml
much, much more (see more complete list in my previous post[1]).
These don't work all too well. But there's another issue with the
approach you suggest. There's no dialectics. You assume that the above
are the last word on the matter uttered by phobos. But things may be
rewritten quite a bit for D2. Speaking of your short list above, indeed
openrj sucks and should disappear (don't get me started). Bigint should
be replaced by Don's implementation. Regexp should be rewritten to use
ranges and templatized characters everywhere (you'd be able to read text
from stdin using a regexp as a separator... anyone who's tried that
knows that's quite a feat). Socket also needs to be rewritten to support
ranges. Xml too, in addition to replacing the slow delegates with fast
aliases. All of these should use the full power and expressiveness of
D2, not transport their old design to it (as they are doing now).
Seriously, if we could drop those (especially, openrj), the situation
would be considerably improved. Much of the initial driving force for
the creation of Tango was a feeling that Phobos was a random accretion
of functionality, including some modules with no justification for
inclusion in a small standard library.
'druntime' would provide an essential functionality to run D programs
on other platforms: gc, compiler, runtime, etc.
std - provide simple and generic functionality, that can be used in
conjunction (unix style): algorithm, range, contracts, math[2], some
helpers/utils, etc.
tango - extended functionality: network, io (including console io),
xml, etc
Tango would depend on Phobos (which is now *very* tiny) and both
depend on druntime. I believe Tango will greatly benefit from using
contracts, ranges and algorithms, that are absent from it.
I think that would be great. The way I see things, however, things like
ranges percolate through other parts of the library so strongly and so
visibly, they are bound to decisively influence a lot more than just
implementation internals.
That's for sure. But if Phobos2 were purged, it'd be a lot more
impressive. Right now it really isn't suitable for building an extended
library around. But after stripping out the detritus, the statements
along the lines of "Tango will *never* be based on Phobos" might disappear.
openrj must die.