www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D learning curve

reply Erik Lechak <prochak netzero.net> writes:
Hello all,

I just started documenting my trip down the D learning curve.  For anyone
that's interested or if your a newbie and don't want to repeat my mistakes take
a look at :

http://www.lechak.info/wiki/index.php?title=D_Language

If you have anything to add or can clarify anything please don't hesitate to
add to the wiki.

Thanks,
Erik Lechak
Jun 13 2008
next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Erik Lechak wrote:
 Hello all,
 
 I just started documenting my trip down the D learning curve.  For anyone
that's interested or if your a newbie and don't want to repeat my mistakes take
a look at :
 
 http://www.lechak.info/wiki/index.php?title=D_Language
 
 If you have anything to add or can clarify anything please don't hesitate to
add to the wiki.

Thanks for doing this. Can you please rename the page to "D programming language" rather than "D language" ? That makes it more google-friendly.
Jun 13 2008
prev sibling next sibling parent Lutger <lutger.blijdestin gmail.com> writes:
Erik Lechak wrote:

 Hello all,
 
 I just started documenting my trip down the D learning curve.  For anyone
 that's interested or if your a newbie and don't want to repeat my mistakes
 take a look at :
 
 http://www.lechak.info/wiki/index.php?title=D_Language
 
 If you have anything to add or can clarify anything please don't hesitate
 to add to the wiki.
 
 Thanks,
 Erik Lechak

Good idea, I'll add some things.
Jun 13 2008
prev sibling next sibling parent Jason House <jason.james.house gmail.com> writes:
To answer one of your questions...
  gdmd has the same command-line usage as dmd.  This allows tools to be written
in one way but use either dmd or gcc as their compiler.  For example, dmd and
gdmd use -release while gdc uses -frelease.

Also, I'm sure the newsgroup would be interested in hearing why you couldn't
get dsss to work reliably.  The configs are usually very simple.  What problems
did you hit?  Setting the initial config?  Writing the config file in your
source directory? Lack of module declarations?

Erik Lechak Wrote:

 Hello all,
 
 I just started documenting my trip down the D learning curve.  For anyone
that's interested or if your a newbie and don't want to repeat my mistakes take
a look at :
 
 http://www.lechak.info/wiki/index.php?title=D_Language
 
 If you have anything to add or can clarify anything please don't hesitate to
add to the wiki.
 
 Thanks,
 Erik Lechak

Jun 13 2008
prev sibling next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Erik Lechak" <prochak netzero.net> wrote in message 
news:g2tf85$ig2$1 digitalmars.com...
 Hello all,

 I just started documenting my trip down the D learning curve.  For anyone 
 that's interested or if your a newbie and don't want to repeat my mistakes 
 take a look at :

 http://www.lechak.info/wiki/index.php?title=D_Language

 If you have anything to add or can clarify anything please don't hesitate 
 to add to the wiki.

 Thanks,
 Erik Lechak

So you know, the difference between Phobos 1 and Phobos 2 is not what version of GDC you're using. It's that there are currently two versions of D itself: D1, which came out at the beginning of 2007 and which is the only version GDC (whatever version it is) supports. And D2, which is currently in an alpha state, which only DMD supports (but there's DMD1 as well). The Digital Mars pages are rather biased to D2 -- almost every link leads to the D2 documentation, so it's understandable that you ended up at the wrong Phobos docs. Also, you might already be aware but the bindings project on dsource (http://www.dsource.org/projects/bindings) has many bindings to common C libraries. Together with BCD and Derelict, which you mentioned, most common C libraries have already been bound, making the somewhat desperate-sounding situation you posit in your wiki a little less desperate ;) (BCD also has a lot more bindings than the wiki page suggests. See here http://www.dsource.org/projects/bcd/browser/trunk/bindings/bcd for a full list.)
Jun 13 2008
next sibling parent reply Erik Lechak <prochak netzero.net> writes:
Hello Jarrett,

 So you know, the difference between Phobos 1 and Phobos 2 is not what 
 version of GDC you're using.  It's that there are currently two versions of 
 D itself: D1, which came out at the beginning of 2007 and which is the only 
 version GDC (whatever version it is) supports.  And D2, which is currently 
 in an alpha state, which only DMD supports (but there's DMD1 as well).

I installed gdc-4.1. I just assumed the Debian package name gdc-4.2 would contain the compiler for D2 and the Phobos2 library. But now you have me wondering what is in the gdc-4.2 package. I think from now on I'm not going to think of D as having a "standard library", until it has a standard library. Thanks, Erik Lechak
Jun 13 2008
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Erik Lechak" <prochak netzero.net> wrote in message 
news:g2un94$16u9$1 digitalmars.com...
 Hello Jarrett,

 So you know, the difference between Phobos 1 and Phobos 2 is not what
 version of GDC you're using.  It's that there are currently two versions 
 of
 D itself: D1, which came out at the beginning of 2007 and which is the 
 only
 version GDC (whatever version it is) supports.  And D2, which is 
 currently
 in an alpha state, which only DMD supports (but there's DMD1 as well).

I installed gdc-4.1. I just assumed the Debian package name gdc-4.2 would contain the compiler for D2 and the Phobos2 library. But now you have me wondering what is in the gdc-4.2 package.

It's GDC, linked against GCC 4.2. And, shock of all shocks, gdc-4.1 is GDC linked against GCC 4.1 ;)
 I think from now on I'm not going to think of D as having a "standard 
 library", until it has a standard library.

It *has* a standard library. It's Phobos. It just so happens that many D users use Tango instead ;) Of course that begs the question: is a "standard library" that is used by a minority all that "standard"?
Jun 13 2008
next sibling parent reply Erik Lechak <prochak netzero.net> writes:
Hello Jarrett,

 "Erik Lechak" <prochak netzero.net> wrote in message 
 news:g2un94$16u9$1 digitalmars.com...
 Hello Jarrett,

 So you know, the difference between Phobos 1 and Phobos 2 is not what
 version of GDC you're using.  It's that there are currently two versions 
 of
 D itself: D1, which came out at the beginning of 2007 and which is the 
 only
 version GDC (whatever version it is) supports.  And D2, which is 
 currently
 in an alpha state, which only DMD supports (but there's DMD1 as well).

I installed gdc-4.1. I just assumed the Debian package name gdc-4.2 would contain the compiler for D2 and the Phobos2 library. But now you have me wondering what is in the gdc-4.2 package.

It's GDC, linked against GCC 4.2. And, shock of all shocks, gdc-4.1 is GDC linked against GCC 4.1 ;)

Holy smokes! That makes sense. I read a little too much into the gdc version number rather than look at the obvious. Newsgroups are a great resource ( for making yourself look stupid ). So the moral of the story is: Debian package gdc-4.1: Phobos version 1 standard library gdc - a D (version 1) compiler gdmd - gdc with command line options mirroring dmd Debian package gdc-4.2: Phobos version 1 standard library gdc - a D (version 1) compiler gdmd - gdc with command line options mirroring dmd Digital Mars package dmd.1.030.zip Phobos version 1 standard library dmd - a D (version 1 ) compiler (Windows and Linux) Digital Mars package dmd.2.014.zip Phobos version 2 standard library dmd - a D (version 2 ) compiler (Windows and Linux) Thanks again, Erik Lechak
Jun 13 2008
parent BCS <ao pathlink.com> writes:
Reply to Erik,


 Holy smokes!  That makes sense.  I read a little too much into the gdc
 version number rather than look at the obvious.  Newsgroups are a
 great resource ( for making yourself look stupid ).
 

looking stupid is a step on the way to not /being/ stupid.
Jun 13 2008
prev sibling next sibling parent reply Sascha Katzner <sorry.no spam.invalid> writes:
Jarrett Billingsley wrote:
 It *has* a standard library.  It's Phobos.  It just so happens that 
 many D users use Tango instead ;)  Of course that begs the question: 
 is a "standard library" that is used by a minority all that 
 "standard"?

Do you have any proof other than the very unrepresentative poll in this newsgroup that Tango has more users than Phobos? As far as I know no one knows the ratio of Phobos and Tango users, so this statement is only an assumption, based on what exactly? The hopes of Tango followers? I don't mean to affront you or any other Tango user, but I respond very harsh if I'm under the impression that someone uses propaganda to push his goal. Are there any download counts published that could give us a *hint* of which library is used more often? LLAP, Sascha
Jun 14 2008
next sibling parent reply Lutger <lutger.blijdestin gmail.com> writes:
Sascha Katzner wrote:

 Jarrett Billingsley wrote:
 It *has* a standard library.  It's Phobos.  It just so happens that
 many D users use Tango instead ;)  Of course that begs the question:
 is a "standard library" that is used by a minority all that
 "standard"?

Do you have any proof other than the very unrepresentative poll in this newsgroup that Tango has more users than Phobos? As far as I know no one knows the ratio of Phobos and Tango users, so this statement is only an assumption, based on what exactly? The hopes of Tango followers? I don't mean to affront you or any other Tango user, but I respond very harsh if I'm under the impression that someone uses propaganda to push his goal. Are there any download counts published that could give us a *hint* of which library is used more often? LLAP, Sascha

You could look at the library code and projects at dsource that is being written. Most projects and almost every big project uses Tango. That is maybe even more important than the number of users.
Jun 14 2008
next sibling parent reply Sascha Katzner <sorry.no spam.invalid> writes:
Lutger wrote:
 You could look at the library code and projects at dsource that is
 being written. Most projects and almost every big project uses Tango.
 That is maybe even more important than the number of users.

If a specific project is significant or not is a highly subjective decision and the pure count of projects which depend on either Phobos or Tango doesn't say much about the real spread or significance of either one. If you want to use other libraries and projects as a benchmark, you have to weight them according to an objective criteria, such as their users and their relevance... which seems to me more complex than the original question. And even if you successfully master this you don't account for a lot of people who don't use any third party libs. LLAP, Sascha
Jun 14 2008
parent reply Lutger <lutger.blijdestin gmail.com> writes:
Sascha Katzner wrote:

 Lutger wrote:
 You could look at the library code and projects at dsource that is
 being written. Most projects and almost every big project uses Tango.
 That is maybe even more important than the number of users.

If a specific project is significant or not is a highly subjective decision and the pure count of projects which depend on either Phobos or Tango doesn't say much about the real spread or significance of either one.

Sure I agree, there is no objective measure, picking any criteria is somewhat arbitrary and biased. I don't think anyone here has even measured anything. But if such objectivity would be a requirement, we would be powerless to make any assertion whatsoever, since even picking the criteria is a biased act. Yet it really isn't all that relevant imho. It's undeniably that Tango is important enough to D programming that it has it's place in the D programming landscape for at least, let's say a significant number of people. It's also fact that phobos is still relevant and has even picked up speed since D2. Hopefully when D2 is getting finalized, this issue will be void and null for the better of D.
Jun 15 2008
parent Sascha Katzner <sorry.no spam.invalid> writes:
Lutger wrote:
 Hopefully when D2 is getting finalized, this issue will be void and
 null for the better of D.

RAmen to that, brother! :) LLAP, Sascha
Jun 15 2008
prev sibling next sibling parent reply Robert Fraser <fraserofthenight gmail.com> writes:
Charles Hixson wrote:
 On Sat, 14 Jun 2008 12:18:00 +0200, Lutger wrote:
 
 Sascha Katzner wrote:

 Jarrett Billingsley wrote:
 ..You could look at the library code and projects at dsource that is 



 written. Most projects and almost every big project uses Tango. That is
 maybe even more important than the number of users.

Which is[was?] a real problem as, for me at least, tango keeps breaking with each new release of D. And I didn't find DSSS to be all that workable either. DMD works fine, and so does Phobos. Tango was unending problems. And I frequently switch to DMD2 for a new release (and sometimes switch back to DMD), so Tango isn't even consistently an option. Perhaps some of the problems of which I'm complaining have been fixed. I last checked over 6 months ago. But I'm not real inspired to try it out again, either. If I wanted to spend all my time fighting with my computer I'd install Gentoo. The upshot is that if a project requires Tango, I generally assume that if I try to use it I'll end up spending all my time in compilation and configuration, and figuring out why what I tried didn't work. I don't know what configurations the Tango people expect a system to have, but mine doesn't have them. Once I tried setting up a special user who only executed DMD1.x (forget which version) with Tango. After 3-4 days I gave that up as a bad job. I didn't even know why it wasn't working.

I've never had problems this bad, but I am disappointed that Tango releases make no attempt to be backwards compatible (they deprecate some syntax for one release and then get rid of it). Already, the simplest code in the book is not working. Pretty soon, anything that depends on the old collection packages is going to break. If you want to use two libraries that depend on different versions of Tango, you're going to be spending some time fixing them up. Of course, Phobos 2 might have this problem, I'm not sure.
 OTOH, I've got to admit that many people seem to really like Tango.  And 
 I have no clue as to what the differences between our systems are.  
 (Though there's probably typically so many differences that even that 
 wouldn't help much.)

The GC/runtime/IO is faster & less buggy than Phobos's in general, so for production code (or code you want to be blazing fast), Tango is th better choice. The upper-level library also has a MUCH nicer API, IMO (you can use it Java-style, like I do, or C/free-function style if you prefer, while Phobos is a hodgepodge of different APIs that don't fit together as well).
Jun 14 2008
parent Sascha Katzner <sorry.no spam.invalid> writes:
Robert Fraser wrote:
 The GC/runtime/IO is faster & less buggy than Phobos's in general, so 
 for production code (or code you want to be blazing fast), Tango is th 
 better choice.

If you want "blazing fast" code, it is mostly the better choice to use customized code. Libraries tend to be over protective (for a good reason) and therefore sometimes wasting a lot of time with unnecessary stuff like error checking for errors that could never occur in a specific situation. Tasks like memory management and IO are very good examples for this. When I'm using a library I don't expect to get the fastest code, but _reliable_ code that I don't have to write on my own. Your observation that Phobos seems to have more bugs _could_be_ a direct consequence of that it is used by more people... SCNR ;) LLAP, Sascha
Jun 15 2008
prev sibling parent janderson <askme me.com> writes:
Charles Hixson wrote:
 On Sat, 14 Jun 2008 12:18:00 +0200, Lutger wrote:
 
 Sascha Katzner wrote:

 Jarrett Billingsley wrote:
 ..You could look at the library code and projects at dsource that is 



 written. Most projects and almost every big project uses Tango. That is
 maybe even more important than the number of users.

Which is[was?] a real problem as, for me at least, tango keeps breaking with each new release of D. And I didn't find DSSS to be all that workable either. DMD works fine, and so does Phobos. Tango was unending problems. And I frequently switch to DMD2 for a new release (and sometimes switch back to DMD), so Tango isn't even consistently an option. Perhaps some of the problems of which I'm complaining have been fixed. I last checked over 6 months ago. But I'm not real inspired to try it out again, either. If I wanted to spend all my time fighting with my computer I'd install Gentoo. The upshot is that if a project requires Tango, I generally assume that if I try to use it I'll end up spending all my time in compilation and configuration, and figuring out why what I tried didn't work. I don't know what configurations the Tango people expect a system to have, but mine doesn't have them. Once I tried setting up a special user who only executed DMD1.x (forget which version) with Tango. After 3-4 days I gave that up as a bad job. I didn't even know why it wasn't working. OTOH, I've got to admit that many people seem to really like Tango. And I have no clue as to what the differences between our systems are. (Though there's probably typically so many differences that even that wouldn't help much.)

What I do is pick a version of the compiler that works and stick with that. As long as you don't need newer versions of tango or other apis that works fine for mw. I sometimes try out updates however if they fail, or are too tricky to fix, I rollback. -Joel
Jun 14 2008
prev sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Sascha Katzner" <sorry.no spam.invalid> wrote in message 
news:g2vrqi$ui1$1 digitalmars.com...
 Jarrett Billingsley wrote:
 It *has* a standard library.  It's Phobos.  It just so happens that many 
 D users use Tango instead ;)  Of course that begs the question: is a 
 "standard library" that is used by a minority all that "standard"?

Do you have any proof other than the very unrepresentative poll in this newsgroup that Tango has more users than Phobos? As far as I know no one knows the ratio of Phobos and Tango users, so this statement is only an assumption, based on what exactly? The hopes of Tango followers? I don't mean to affront you or any other Tango user, but I respond very harsh if I'm under the impression that someone uses propaganda to push his goal. Are there any download counts published that could give us a *hint* of which library is used more often? LLAP, Sascha

I'm mostly going off of what Lutger has said, as well as a somewhat subjective rating based on my experience on the D IRC channel. As for download counts, I'm not so sure any real comparison could be made. Phobos comes with the compiler, which can be obtained from many sources (directly from DM, the GDC sourceforge page, debian packages). Also, Tango can be checked out of SVN anonymously so I don't think there's any reliable way of knowing how many people have it.
Jun 14 2008
parent Sascha Katzner <sorry.no spam.invalid> writes:
Jarrett Billingsley wrote:
 As for download counts, I'm not so sure any real comparison could be
 made. Phobos comes with the compiler, which can be obtained from many
 sources (directly from DM, the GDC sourceforge page, debian
 packages).  Also, Tango can be checked out of SVN anonymously so I
 don't think there's any reliable way of knowing how many people have
 it.

I think it is pretty safe to assume that the majority of Tango users prefer the pre-bundled package and not the subversion way (the same should be true for DMD/Phobos). And since the compiler is already included in this release you don't have to subtract this count from the one of the DM website. So I think if you account for the same time period the download counts should be a very good hint for the usage ratio of the two libraries. LLAP, Sascha
Jun 14 2008
prev sibling parent "Nick Sabalausky" <a a.a> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
news:g2unqe$18lg$1 digitalmars.com...
 It *has* a standard library.  It's Phobos.  It just so happens that many D 
 users use Tango instead ;)  Of course that begs the question: is a 
 "standard library" that is used by a minority all that "standard"?

I might be off-base, but I've always thought of it like this: Phobos: Official Standard Tango: De Facto Standard Of course, Phobos being the only one that supports D2 right now kinda changes things for the moment.
Jun 14 2008
prev sibling parent Charles Hixson <charleshixsn earthlink.net> writes:
On Sat, 14 Jun 2008 12:18:00 +0200, Lutger wrote:

 Sascha Katzner wrote:
 
 Jarrett Billingsley wrote:
..You could look at the library code and projects at dsource that is 



 written. Most projects and almost every big project uses Tango. That is
 maybe even more important than the number of users.

Which is[was?] a real problem as, for me at least, tango keeps breaking with each new release of D. And I didn't find DSSS to be all that workable either. DMD works fine, and so does Phobos. Tango was unending problems. And I frequently switch to DMD2 for a new release (and sometimes switch back to DMD), so Tango isn't even consistently an option. Perhaps some of the problems of which I'm complaining have been fixed. I last checked over 6 months ago. But I'm not real inspired to try it out again, either. If I wanted to spend all my time fighting with my computer I'd install Gentoo. The upshot is that if a project requires Tango, I generally assume that if I try to use it I'll end up spending all my time in compilation and configuration, and figuring out why what I tried didn't work. I don't know what configurations the Tango people expect a system to have, but mine doesn't have them. Once I tried setting up a special user who only executed DMD1.x (forget which version) with Tango. After 3-4 days I gave that up as a bad job. I didn't even know why it wasn't working. OTOH, I've got to admit that many people seem to really like Tango. And I have no clue as to what the differences between our systems are. (Though there's probably typically so many differences that even that wouldn't help much.)
Jun 14 2008
prev sibling next sibling parent Jonathan Crapuchettes <jcrapuchettes gmail.com> writes:
Just as a heads-up, I use both dmd and gdc on a regular basis and I have found 
that as nice as gdc is, dmd is a lot more bug free. I usually try gdc first and 
if there is a bug then I compile with dmd.
Thought that might help a little at times.
JC

Erik Lechak wrote:
 Hello all,
 
 I just started documenting my trip down the D learning curve.  For anyone
that's interested or if your a newbie and don't want to repeat my mistakes take
a look at :
 
 http://www.lechak.info/wiki/index.php?title=D_Language
 
 If you have anything to add or can clarify anything please don't hesitate to
add to the wiki.
 
 Thanks,
 Erik Lechak

Jun 13 2008
prev sibling parent Lars Ivar Igesund <larsivar igesund.net> writes:
Erik Lechak wrote:

 Hello all,
 
 I just started documenting my trip down the D learning curve.  For anyone
 that's interested or if your a newbie and don't want to repeat my mistakes
 take a look at :
 
 http://www.lechak.info/wiki/index.php?title=D_Language
 
 If you have anything to add or can clarify anything please don't hesitate
 to add to the wiki.
 
 Thanks,
 Erik Lechak

I'd just like to note that you can download the compilers from the Tango pages too, in which case they come with Tango instead of Phobos (some downloads do have Tangobos though). -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Jun 18 2008