The great compromise of the D standard library

Kris foo at bar.com
Thu Oct 18 01:41:29 PDT 2007


"Ender KaShae" <astrothayne at gmail.com> wrote in message
>I have great misgivings over the divide among the D community between 
>standard libriraries.  The contintion will no doubt eventually lead to a 
>schism reduce the reusibility of D code.

Choice is not such a bad thing at times. If Tango did not exist, things 
would be arguably a lot worse for D. After all, it was written by people who 
feel a desire to inject D into the commercial development space, where 
phobos could not even be considered as a realistic option.  To be clear, 
Tango is targeted at the commercial space.

Also, I think you'll find that all the major D libraries are operational and 
maintained upon Tango. There's likely to be good reason for that.


> 1.) Phobos and Tango are combined into a single Standard library, as 
> Phobos seems to be lower level, it would make sense for Tango to call 
> Phobos functions and for alias's to be made between equivilent entities 
> that exist in both libraries

You'll forgive me, but this is apparently something said without even a 
vague inkling of why Tango exists or what the distinctions might be. It's so 
grossly simplified that it's hard to even begin an explanation :)

I will note that Tango is a de-coupled design, and thus can be happily 
deployed in a variety of configurations. The lower level is known to be 
considerably more capable and robust than the phobos equivalent, so Tango is 
basically a better library right at the very basic core.


> 2.) Programmers are incouraged to contribute to the new standard library

That is exactly what Tango is all about. And it shows in the breadth and 
depth of the library. There are significant contributions from people with 
exceptional talent, and that's what gives Tango much of its strength.


> 3.) Walter will remain the final say on what contributions are added to 
> the library

Walter is a supreme compiler-writer but, and I'm sure he won't mind me 
saying so, he is not a supreme library designer. In fact, the requirements 
for what makes a good language designer are arguably diametrically opposed 
to what makes for a good library designer. I suspect you give the Tango 
folks far too little credit ... or perhaps they're just a bunch of rank 
amateurs after all :)


> 4.) The name for the standard library will be neutral between Digital Mars 
> and DSource
>
> I believe this compromise will address most of the issues though it would 
> have to be agreed upon by both factions.

If only it were that easy! Unfortunately what you describe is a compromise 
with the worst of everything and little realistic value. Take that with a 
pinch of salt if you prefer, but some of us have been around long enough to 
understand the tradeoffs as well as anyone. Probably better than most.


> This has the additional advantage have creating a library with both low 
> level procedural and higher level object-oriented parts.  This 
> hybridization is one of the things that attracted me most to D in the 
> first place.


An oft-stated point. A more procedural layer is something that was promised 
for Tango during the D conference, so it is being worked on. We've been 
overly conservative about the library in general, but now that the tyres 
have been kicked sufficiently you'll see some neat things happening soon 
enough.

BTW: this opinion that Tango's all about OO is just wildly incorrect ... 
there's perhaps more vanilla functions and IFTI templates than there are 
classes in Tango (it's a modern library of considerable depth) and, 
conversely, phobos has a significant percentage of classes also. What 
appears to propagate this false notion is that some rather specific library 
functionality happens to be OO in Tango and not in phobos. It may well be 
true that Tango is /more/ OO than phobos, but then it is also a 
substantially broader and deeper library. Some types of library 
functionality are simply better suited to OO, which is why phobos often uses 
that model also. There's a whole lot of misconception in this arena, some of 
which was spawned early on when Tango was still quite young and even more 
conservative.

You talk about merging functionality. In order to get a rather vague picture 
of functionality, I suggest you count the number of modules in std.* and 
compare that against the number in tango.*  ::  the tango example called 
filescan.d tells me there's around 300 D modules in Tango, with around 75 in 
phobos. Because of the de-coupled and layered nature of Tango, it is 
actually easier to get it running on a new platform, despite the breadth. 
There's far less bottom-to-top architectural inter-connectivity to trip you 
up, since there's been a lot of effort made to explicitly avoid that. 
Actually merging Tango into phobos would cause the latter to basically 
disappear as background noise ... they are that different in respective 
capability. You might as well compare a 1982 C library, with that of C#

In the past, we've made a deliberate effort to avoid comparing phobos 
against Tango, but in the last month there's been so much misinformation 
that we've started to take the gloves off a little. Yes, some people prefer 
the 'style' of phobos. Good! Variety is the spice of life. Having said that, 
Tango will carefully add in some of that 'style' that some people prefer.

I hope this gives you, Ender, some kind of insight into the realities of 
Tango :p






More information about the Digitalmars-d mailing list