D1, D2, Tango, Phobos, Std, Runtime

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Apr 6 08:43:16 PDT 2012


On Fri, Apr 06, 2012 at 05:28:37PM +0200, Paul wrote:
> I was reading a wiki about D and it talked about Tango vs. Phobos.  I
> read some items on runtime vs. standard libraries as well.  I am bit
> confused about all of it.  Are the standard libraries compiled into
> every exe and then the runtimes linked as needed?  Are they all or
> nothing entities?  In other words if I need a function to I have to
> include the whole library in my exe?  Is Tango the latest and Phobos
> the original?  Which should a new programmer start with?  Appreciate
> your patience(s).

The whole Tango vs. Phobos debacle happened during D1 (which is a
snapshot of an early version of D), allegedly due to some issues in
Phobos. That issue no longer exists in D2, though. Phobos is now *the*
standard library in D2. I don't think Tango is fully ported to D2 yet,
although I heard someone was working on it, and IIRC there is a
development snapshot of it available somewhere.

For a new learner, it's highly recommended to go with D2 + Phobos.

As for linking, currently the standard library is linked into every exe.
There's a plan to eventually support runtime shared libs, but this
hasn't been done yet.  Well, technically speaking, only the parts that
you actually use are linked into the exe: a large part of Phobos is
implemented as templates, and these aren't instantiated unless you use
them. Plus, even with static linking, the linker generally is clueful
enough to only include code units actually referenced by your program.
So if you never use std.json, for example, it won't get linked into the
exe.


T

-- 
Why do conspiracy theories always come from the same people??


More information about the Digitalmars-d-learn mailing list