www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - druntime vs phobos

reply "Mattbeui" <matheus_nab hotmail.com> writes:
Hi,

What are the main differences between these two libs?

Since I saw:

On Github:

Druntime: Druntime is the minimum library required to support the 
D programming
language. It includes the system code required to support the 
garbage
collector, associative arrays, exception handling, array vector 
operations,
startup/shutdown, etc.

phobos: Runtime library for the D programming language — Read 
more d-programming-language.org


On this forum - Index:

D-runtime: Runtime library design and implementation

phobos: Phobos standard library design and implementation


1) Using D2 I need both?

2) Where phobos replaces druntime and vice-versa?

Thanks.
Feb 01 2012
next sibling parent "Marco Leise" <Marco.Leise gmx.de> writes:
Don't worry about that. You will only be using Phobos2 with D2.
druntime was split out of Phobos, to provide the bare minimum (GC, arrays,  
...) of D, so it was easier to use without Phobos or with a different  
library like Tango. Both are currently used and actively developed.  
druntime is compiled right into Phobos2, so you will probably not even  
find it as a separate file in your installation of D2, but the core.*  
modules are generally part of druntime. That is where you find the garbage  
collector and some basic OS bindings amongst other things.
Feb 01 2012
prev sibling next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Thursday, February 02, 2012 02:33:39 Mattbeui wrote:
 Hi,
=20
 What are the main differences between these two libs?
=20
 Since I saw:
=20
 On Github:
=20
 Druntime: Druntime is the minimum library required to support the
 D programming
 language. It includes the system code required to support the
 garbage
 collector, associative arrays, exception handling, array vector
 operations,
 startup/shutdown, etc.
=20
 phobos: Runtime library for the D programming language =E2=80=94 Read=

 more d-programming-language.org
=20
=20
 On this forum - Index:
=20
 D-runtime: Runtime library design and implementation
=20
 phobos: Phobos standard library design and implementation
=20
=20
 1) Using D2 I need both?
=20
 2) Where phobos replaces druntime and vice-versa?

druntime contains the D runtime. It's required for any D program to wor= k.=20 Phobos is D's standard library and thus uses druntime. It's not actuall= y=20 required, but you're not likely to write a D program without it. Both a= re=20 provided with dmd combined as a single library (libphobos.a or phobos.l= ib,=20 depending on the OS). The core.* modules are in druntime, and the std.*= =20 modules are in Phobos. - Jonathan M Davis
Feb 01 2012
prev sibling next sibling parent Sean Kelly <sean invisibleduck.org> writes:
On Feb 1, 2012, at 5:33 PM, Mattbeui wrote:

 Hi,
=20
 What are the main differences between these two libs?

Druntime contains all the code that every D app needs to run. This = includes routines called by compiler-generated code, the garbage = collector, and thread support (needed so the GC can find and scan user = threads). Phobos is the D standard library and its use is completely = optional, though it's linked by default by DMD.
 1) Using D2 I need both?

Strictly speaking: no. You can use --defaultlib=3Ddruntime and = --debuglib=3Ddruntime to avoid linking Phobos, assuming that you have = the druntime library available.
 2) Where phobos replaces druntime and vice-versa?

There are a few instances where Phobos aliases stuff in Druntime, but = this is typically for compatibility reasons. There should be little to = no overlap in functionality between the two. Think of core (druntime) = as being roughly equivalent to java.lang.=
Feb 01 2012
prev sibling parent "Mattbeui" <matheus_nab hotmail.com> writes:
I chose myself to reply this topic, but I would like to say 
thanks to:

Marco Leise, Jonathan M Davis and Sean Kelly for answering my 
questions.

I really understood now.

Thanks again.
Feb 01 2012