questions on PhanTango 'merger' (was Merging Tangobos into Tango) - long-term vision

Bill Baxter dnewsgroup at billbaxter.com
Wed Oct 10 21:32:19 PDT 2007


Kris wrote:
> "0ffh" <spam at frankhirsch.net> wrote in message 
> news:fej1ad$30el$1 at digitalmars.com...
>> Kris wrote:
>>> Perhaps another way to ask these questions might be this:  what 
>>> type/style of phobos functionlaity would you like to see in Tango?  BCS 
>>> hinted at this early on, and it would be useful to hear more of that ...
>> What I like most about Phobos is it's ease-of-use and it's style.
>> I know you are already working on stand-alone functions in Tango,
>> and it's a good thing to do, IMHO. :)
>>
>> Regards, Frank
> 
> 
> Thanks, Frank. If you could be specific about some of those, it would help 
> notably ... can you provide an example or two, please? 

Ideally, tango would just be a library I could import like any other. 
But assuming that's not going to happen, here's what I think could make 
the schism easier to deal with.

*** Convenience functions ***

Here's a list of things I actually use frequently in phobos, ordered 
roughly by frequency of use:

std.stdio : writef,writefln
std.string : format
std.math
std.conv
std.regexp
std.path
std.stream : BufferedFile
std.file : exists,isFile,isDir

If there were equivalently easy-to-use versions of those in Tango, that 
would cover my uses.  And maybe there are already for some, but i see 
for example that std.path is replaced by a cumbersome OO interface, and 
std.conv has no recommended equivalent.
[http://www.dsource.org/projects/tango/wiki/PhobosTangoMigration]

Anyway, to use anything beyond those few up there (and even some of 
those) I have to look up what the API is on the web page.

BUT one advantage of Phobos there, is that I can find anything I need 
pretty quickly with that list of modules on the left hand side of the 
Phobos page.

*** Better API documentation ***

In contrast, the closest thing with Tango seems to be the Tango API 
Index (http://www.dsource.org/projects/tango/docs/current/) which has a 
huge list of names of everything in Tango, much of which is 
implementation detail users shouldn't be mucking with.   So it's hard to 
find the thing you're looking for if you just want to know how to open a 
file.

I think a simplified module index that omits things users won't 
generally need would help on that front.  And a one-line description 
next to each link wouldn't hurt either.  Topical groupings might help 
too.  Like have a list of every module related to "Text Processing" 
"Networking".  The categories in the reference manual might be a good 
place to start.

Another Tango doc gripe is that the modules don't have any useful 
module-level descriptions.  Look at phobos' std.conv for comparison: 
http://www.digitalmars.com/d/1.0/phobos/std_conv.html
The page starts off with a useful description of what std.conv is for. 
Given that, I can quickly tell if std.conv is the right module for the 
job or not (as in it provides atoi and atol type conversions, rather 
than being a module for doing temperature conversions or image 
convolutions or something).  Other modules in Phobos are even better, 
like std.boxer, giving both a quick overview *and* a few basic usage 
examples.

*** Easier switching back and forth ***

It seems that installing Tango itself is pretty easy now, at least if 
you have dsss installed, but AFAIK that renders all your phobos-based 
libs useless.  Tango should do two things to make switching back and 
forth easier.
1) Tanogobos should be a part of the default install
2) A solution for tango-phobos switching should be installed by default. 
  I don't care how it's done but I think it should come in two flavors:
   a) a per-shell transient method for changing the default
   b) a global per-installation (or per-user if there's some way to get 
that) method.

As someone who still has a lot of code written that depends on Phobos, I 
want to know that I can go back and forth between Phobos and Tango 
easily.  Right now if I want to install Tango and still use Phobos 
occasionally, I have to choose between three different fiddly techniques 
(http://www.dsource.org/projects/tango/wiki/PhobosTangoCooperation). 
The web page gives no reason to prefer one method over another, so that 
means I have to read all three and understand how they work well enough 
to determine which method is the best for me.  Something like this 
should just happen automatically as a part of installing Tango.

If I'm going to write a library that depends on Tango, I want to be able 
to say to potential users that all they have to do to use it is:

"""
    1) Install tango (dsss net install tango).
    2) Type the command "set_dlibrary tango"[*] at a command prompt.
and later
    3) if you need to go back to Phobos type "set_dlibrary phobos"[*]

[*] To make the switch persistent use "set_dlibrary -p"
"""

Achieving this level of simplicity probably requires some cooperation 
from Walter.  But it seems utterly attainable.  Unlike merging the runtimes.

--bb



More information about the Digitalmars-d mailing list