Two "standard" libraries???

kris foo at bar.com
Sun Sep 16 17:06:49 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?
> 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?

I perhaps answered /some/ of this in a recent post:
<quote>
Without hitting on a whole lot of detail, the Tango runtime support 
(which includes threads, exceptions, etc) has always been beyond what 
Phobos offered. For example, Tango has fibers (Mik & Sean). That needs 
to be tied into the GC also (which it is), and makes the runtime layer 
incompatible with the Phobos equivalent. Tango also has internal support 
for exception backtraces which hooks in with, for example, the 
Flectioned library from Thomas. The import path structure (or lack 
thereof) within the Phobos library, along with the namespace collisions, 
unfortunately lends itself to a lack of modularity and scalability. The 
Tango GC was both very fast and known to be free of deadlock, while the 
Phobos one was not until comparatively recently etc. etc. These are not 
intended as criticisms of Phobos, but they and many more became reason 
enough to take the path that the Tango folks did.
</quote>


> 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.

That's what Tangobos does?


> 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.

It already has quite strict change controls. Changes generally have to 
get past three people to make it into the library. New submissions are 
scrutinized carefully. We generally set the 'bar' pretty high in a 
number of ways.

Those three people have learned to work effectively with each other 
(often surprisingly so), such that we often preempt the need to have 
long discourses over x or y or z. That aspect helps to avoid getting 
mired in the quicksand of endless reviewing.

FWIW: from both a social and an engineering perspective, Tango is and 
has been a highly educational and fun journey. It was really quite odd 
to find ourselves all sitting on the same seat in the back of taxicab 
the other week (we'd not met before: Sean and I had to describe what 
we'd be wearing ... Larsivi coincidently met Sean after his somewhat 
distinct name had shown up on a notice board at the airport ...)


> 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.

As a team, we've had this concern also. The hierarchy does make sense, 
but it can be deep in places. Something needs to be done in this regard, 
but it's not as simple as (say) dump everything into one folder ;)

Thankfully, Tango is deliberately loosely coupled. There have been times 
where we have "energetically" discussed retaining or dropping a specific 
/convenience/ method or function if it caused cross-coupling to occur in 
an expensive manner. A lot of Tango is actually free-standing, or very 
close to it.

Having said that, Tango is also far broader and deeper than the dmd 
library (the user-level library seems to have 414 'module' keywords). If 
dmd had all the same functionality, dropped into one folder, you might 
have different problems?


> I recently invested a number of months in learning C# - the language
> took all of a few days to pick up, but the .NET BCL (much like the C++
> STL) is one abstract, self-referencial beast that I simply never
> expect to master. Compared with that, my week-long experience with
> Phobos has got me to the point where I know where almost everything I
> need on a daily basis is already.
> Just a newcomer's $.2.

All valid and good input! I'm not sure how we'll resolve that, but 
suggestions are really welcomed; especially in the form of a Ticket :P

(Tickets enable us to track things much better)


> Thanks to Digital Mars for a wonderful language, and the Tango team
> for healthy competition!

Welcome!



More information about the Digitalmars-d mailing list