Any chance to call Tango as Extended Standard Library

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jan 22 08:56:48 PST 2009


Don wrote:
> Daniel Keep wrote:
>>
>> Andrei Alexandrescu wrote:
>>> Don wrote:
>>>> [snip]
>>>>
>>>> It means that any code which uses a library based on both Tango and a
>>>> library based on Phobos will end up with two copies of all of the
>>>> functions, and they'll have different name mangling etc. You end up
>>>> with two incompatible Bigints, for example, even though they have
>>>> identical code inside.
>>> Oh, I see. You want your library to be usable whether the end user
>>> prefers Phobos or Tango. But then why not stick it into a namespace of
>>> your choosing? Let's say your libraries are general enough to warrant
>>> putting them in a common core, but then anyone who defines some library
>>> don't have to go to the "core ombudsman" to add it to the common
>>> namespace. They'd just create unique namespaces of their own. No?
>>>
>>>
>>> Andrei
>>
>> I think he means this: let's say you're writing app A.  A depends on
>> libraries B and C.  B depends on Phobos, and C depends on Tango.  Both B
>> and C happen to use BigInts or IO or anything else that isn't shared.
>>
>> All of a sudden, you've now got to link in TWO standard libraries
>> instead of just one, each with potentially duplicated code.
> 
> And you can't obtain a BigInt from library B and pass it into library C, 
> since they are different types; even though they have 100% identical 
> source code except for the name.

This will partially be solved by structural casts. I have an 
implementation but haven't put it in phobos yet. Structural casts will 
allow types that have the same layout to be cast to one another. Of 
course, that's still not ideal but it's one step forward.


Andrei



More information about the Digitalmars-d mailing list