Phobos vs Tango! What's your opinion?
Bill Baxter
dnewsgroup at billbaxter.com
Tue Apr 17 19:07:45 PDT 2007
Daniel Giddings wrote:
> Dlé wrote:
>> Hello people!
>>
>> I'm working and studing this new (for me :-) ) language. I have some
>> questions and i think your opinion is so precious for me.
>>
>> First, D is a new language.The official library is Phobos. Why another
>> library how Tango that is not compatible with Phobos? Because Tango is
>> opensource and the comunity can develop the library?
>>
>> Why not a concept how java for example, where we have only one big
>> family of class?
>>
>> Fundametals differences between Phobos and Tango?
>>
>> Tank's!
>>
>> I wait your opinions!
>>
>> Dié
>>
>
> It is rather unfortunate having both. Ideally Tango should be a
> stand-alone library that is an optional (and useful) extra. [Aside: is
> it possible to get the incompatible code in some way included in Phobos
> so they can run alongside happily? - are the incompatibilities in Tango
> enough to break large portions of Phobos if they were moved to it?]
>
> They are incompatible however, forcing anyone developing to choose
> between the two and fragmenting libraries where developers haven't
> explicitly supported both.
From what I'm guessing based on what Gregor said, his "Tangobos" will
be based on Tango, but will allow you from a Tango app to do things like
"import std.string;"
How he's going about it... I don't know. I think you pretty much have
to create a modified copy of the Phobos source tree with all instances
of toString changed to toUtf8. Then you need to make a compatibility
std.gc module that delegates all the heavy lifting to Phobos. toString
to toUtf8 should be pretty easy to automate with sed/perl/std.regex.
The std.gc stuff used in phobos looks pretty minimal. Just
file.d,outbuffer.d,stdio.d, and zlib.d seem to call the gc directly.
Although toString is also a standalone function in addition to being a
method on Phobos' object. So I guess that makes it a little trickier to
translate.
Oh, and there are exceptions to deal with too. And probably a few more
things I haven't thought of but Gregor is knee-deep in trying to get
working.
--bb
More information about the Digitalmars-d
mailing list