Two "standard" libraries???

Sean Kelly sean at f4.ca
Mon Sep 17 10:13:58 PDT 2007


David Wilson wrote:
> On 15/09/2007, Sean Kelly <sean at f4.ca> wrote:
> 
>> it's not really possible to use Tango and Phobos
>> together in the same app at the moment.  If you'll forgive my hubris, I
>> /do/ believe the Tango runtime is better than the Phobos runtime, but
>> this basically means that I think it would be foolish to just toss out
>> the Tango runtime and turn Tango into another user-level library.  And
>> that's why we are where we are today :-)
> 
> I asked about this on IRC recently and didn't get a satisfying
> response - beyond the extra functionality available in Phobos (which
> is a great thing, of course), is there anything that really
> substantiates the claim to "better" about the runtime part?

Many of the differences are really quite subtle, and to be honest, I 
don't even remember what half of them are.  I've tried to come up with a 
laundry list in the past, but haven't been very successful.  However, I 
will try to answer your questions below.

> Specifically I noticed the GC had the Digital Mars copyright notice,
> and on asking you about this, you told me that the two GCs were
> (paraphrasing) "essentially the same". In that case, what is left in
> the Tango runtime that is "better" that justifies it being more than
> just a really complete class library?

The easiest thing to point to would be the threading package.  It is 
deadlock-free, as far as I know, as it the threading/GC integration. 
The same cannot be said of Phobos, last I checked.  This is one of the 
most frequently mentioned items when I ask people why they switched to 
Tango from Phobos.

Another difference I personally feel is very important is simply the 
modular design.  Basically all of Ares' users were using it for kernel 
development and other such projects, and the structure of the library 
(which has been refined since Ares) simplifies such things.

As for the rest, the differences are all fairly subtle.  The Tango 
runtime contains customization points in various different areas--a 
custom assert handler can be bolted in, for example.  But I will admit 
that the quality of the Phobos runtime has improved in the year and a 
half since Tango development began, and the code differences between the 
two are smaller now than they used to be.

> As a very-newcomer to D, the Tango/Phobos choice was the first and
> most bitter lemon I have had to chew on yet, and I'm still not sure I
> really understand the differences. It seems to me with D's language
> features (e.g. alias), one or the other could very easily be melded
> into shape for perfect compatibility with the other, given that both
> codebases will have very similar semantics given their shared
> ancestry.

For the most visible features of the Tango runtime, look at these modules:

http://www.dsource.org/projects/tango/docs/current/tango.core.BitManip.html
http://www.dsource.org/projects/tango/docs/current/tango.core.Exception.html
http://www.dsource.org/projects/tango/docs/current/tango.core.Memory.html
http://www.dsource.org/projects/tango/docs/current/tango.core.Runtime.html
http://www.dsource.org/projects/tango/docs/current/tango.core.Thread.html

> I understand that Phobos is a very slowly evolving library, but in the
> face of the community's desire to scale D to a world-class programming
> language, that can only be a good thing. At the very least to compete
> in an environment like that, Tango would need much stricter change
> controls (say, a committee) to ensure changes weren't being made "on
> whim" and actually had some community benefit.

Tango was created largely because community involvement in Phobos 
development has been frustratingly difficult.  Its design will remain in 
flux until it reaches 1.0 because we very much want to avoid breaking 
changes, deprecation, etc, after that point.  I am hoping we will get 
enough feedback before then that the design is fairly well tested and 
proven so this does not happen.

> Finally I have a stylistic issue regarding Tango: despite its
> relatively small size, the package nesting is already sufficient to
> confuse me; I find it difficult to delve in and find what I'm looking
> for. The disparity and feeling of seeming emptiness that Phobos gives
> may be uncomfortable at first, but when you realize there is no
> superhierarchy of classes and packages, and nearly any module in it is
> self contained, it suddenly becomes a much friendlier environment.

Personally, I feel that the IO features in Tango are quite confusing, 
simply because there are so many options available.  This is one area 
where Tango definitely caters to expert programmers more than novice 
programmers, and I do feel we could do better to make this package more 
accessible to new users.  Documentation is obviously a huge (and needed) 
portion of this, but some additional convenience features may be 
appropriate as well.  But it is difficult for us to know exactly what 
areas to address.  User feedback is invaluable for finding trouble spots 
here and in all other areas of the project--documentation included.


Sean



More information about the Digitalmars-d mailing list