April 17, 2007
Hi Walter,
what is the rationale for having "phobos" hardcoded in DMD?

Would there be much work to free this up to make it a configuration item instead?

-- 
Derek Parnell
Melbourne, Australia
"Justice for David Hicks!"
skype: derek.j.parnell
April 17, 2007
Derek Parnell wrote:
> Hi Walter,
> what is the rationale for having "phobos" hardcoded in DMD? 
> 
> Would there be much work to free this up to make it a configuration item
> instead?
> 

Please put that on your TODO list.. doesn't have to be on the top, but it would be really great. Especially for Phobos & Tango interoperability, and things like OS development.. always having to link in a libphobos.a is a bit of a pain in the ass sometimes, especially in this case.
April 17, 2007
Derek Parnell wrote:
> Hi Walter,
> what is the rationale for having "phobos" hardcoded in DMD? 
> 
> Would there be much work to free this up to make it a configuration item
> instead?

This is exactly question I ask when read an install note on Ares at a time. People are hesitant to even try Tango because of it.

I think there should be a compiler switch for not to link against Phobos implicitly.

-- 
serg.
April 17, 2007
Reply to Serg,

> Derek Parnell wrote:
> 
>> Hi Walter,
>> what is the rationale for having "phobos" hardcoded in DMD?
>> Would there be much work to free this up to make it a configuration
>> item instead?
>> 
> This is exactly question I ask when read an install note on Ares at a
> time. People are hesitant to even try Tango because of it.
> 
> I think there should be a compiler switch for not to link against
> Phobos implicitly.
> 

How about put that setting in the dmd.conf file and put sections in it so that one lib or another can be picked just by changing a command line switch.


April 18, 2007
Derek Parnell wrote:
> Hi Walter,
> what is the rationale for having "phobos" hardcoded in DMD?
> 
> Would there be much work to free this up to make it a configuration item instead?
> 

ooooh, please do this, Walter!

BA
April 18, 2007
Brad Anderson wrote:
> Derek Parnell wrote:
>> Hi Walter,
>> what is the rationale for having "phobos" hardcoded in DMD? 
>>
>> Would there be much work to free this up to make it a configuration item
>> instead?
>>
> 
> ooooh, please do this, Walter!
> 
> BA

I would love to have this command-line controlled, as well as configurable in dmd.conf and sc.ini. I wish both Tango and Phobos could be bundled together w/ the DM supplied compiler download as well.
April 18, 2007
On Wed, 18 Apr 2007 07:31:32 +1000, Derek Parnell wrote:

> Hi Walter,
> what is the rationale for having "phobos" hardcoded in DMD?

Maybe I haven't been clear enough. My question above is a sincere one and
not rhetorical. I believe that it is possible that there is a very good
reason for having Phobos hard coded, it's just that I don't know what that
might be and I would like to find out.

> Would there be much work to free this up to make it a configuration item instead?

By "configuration item", I am not trying to imply any specific implementation. Rather I'm just expressing a desire that Walter allows something external to DMD, but controllable by the developer, to be used to inform the linker what should be the /default/ library to link against. I suppose if none is supplied by the developer to DMD that DMD could use "phobos" as its in-built default name.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Justice for David Hicks!"
18/04/2007 12:14:44 PM
April 18, 2007
There should be compiler switch not to link against either Phobos or Tango, IMHO. - This would encourage people to try to make some low-level libraries themselves...
It should be something like --nostdlib in GCC, and/or --nocrt later (to totaly avoid linking against libc).

Regards
April 18, 2007
Derek Parnell wrote:
> On Wed, 18 Apr 2007 07:31:32 +1000, Derek Parnell wrote:
> 
>> Hi Walter,
>> what is the rationale for having "phobos" hardcoded in DMD? 
> 
> Maybe I haven't been clear enough. My question above is a sincere one and
> not rhetorical. I believe that it is possible that there is a very good
> reason for having Phobos hard coded, it's just that I don't know what that
> might be and I would like to find out.

Only Walter knows the answer to this, but I'll offer a guess.

I suspect the reason that it's hardcoded is because it'd be next to impossible (if not impossible) to write a D program that doesn't require something stored in phobos.lib. In particular, the garbage collector is in there. The standard lib also contains the object prototype and the code required to sort an array. Since you would need an object to work with exceptions, the program that doesn't need something from the standard lib is going to be very stripped down.

Of course, they've made Tango work without Phobos by studying which parts of Phobos are required to be in the standard library by the language and put something similar in Tango.

It would be nice if we could use some sort of command line line switch to specify to use another lib than phobos.lib so that Tango and Phobos could coexist more easily. Programs would still be unable to use Tango and Phobos at the same time (at least until Gregor Richards released "tangobos"), but a "alternative standard lib" switch could still come in handy.


>> Would there be much work to free this up to make it a configuration item
>> instead?
> 
> By "configuration item", I am not trying to imply any specific
> implementation. Rather I'm just expressing a desire that Walter allows
> something external to DMD, but controllable by the developer, to be used to
> inform the linker what should be the /default/ library to link against. I
> suppose if none is supplied by the developer to DMD that DMD could use
> "phobos" as its in-built default name.

I don't see why this wouldn't be possible. I'll bet that someone familiar with the DMD front end could figure out how hard (hopefully it'd be easy) this would be. (But looking at the DMD front end isn't one of my talents.)

-- 
jcc7
Top | Discussion index | About this forum | D home