www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Why libphobos2.a?

reply Graham Fawcett <fawcett uwindsor.ca> writes:
Hi folks,

Newbie question: if the D compiler (a) is very fast and (b) can
optimize application code when it has access to all library sources,
then isn't libphobos2.a a premature optimization? Why have it at all,
when the Phobos sources are available?

Thanks,
Graham
Jun 02 2010
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Graham Fawcett wrote:
 Newbie question: if the D compiler (a) is very fast and (b) can
 optimize application code when it has access to all library sources,
 then isn't libphobos2.a a premature optimization? Why have it at all,
 when the Phobos sources are available?
The global optimization at the moment is limited to inlining. Most functions are not inlinable.
Jun 02 2010
parent reply Ellery Newcomer <ellery-newcomer utulsa.edu> writes:
On 06/02/2010 12:59 PM, Walter Bright wrote:
 Graham Fawcett wrote:
 Newbie question: if the D compiler (a) is very fast and (b) can
 optimize application code when it has access to all library sources,
 then isn't libphobos2.a a premature optimization? Why have it at all,
 when the Phobos sources are available?
The global optimization at the moment is limited to inlining. Most functions are not inlinable.
Don't you need the phobos source regardless of whether you have a lib file?
Jun 02 2010
next sibling parent Jacob Carlborg <doob me.com> writes:
On 2010-06-02 20:19, Ellery Newcomer wrote:
 On 06/02/2010 12:59 PM, Walter Bright wrote:
 Graham Fawcett wrote:
 Newbie question: if the D compiler (a) is very fast and (b) can
 optimize application code when it has access to all library sources,
 then isn't libphobos2.a a premature optimization? Why have it at all,
 when the Phobos sources are available?
The global optimization at the moment is limited to inlining. Most functions are not inlinable.
Don't you need the phobos source regardless of whether you have a lib file?
It's enough with D interface files/headers. Look at object.di and core.Thread.di(I think) for example. -- /Jacob Carlborg
Jun 02 2010
prev sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Ellery Newcomer wrote:
 Don't you need the phobos source regardless of whether you have a lib file?
No. You can use header (.di) files instead.
Jun 02 2010