[deleted]•

Can any D folks tell me what I should use to get started with D? There seems to be D 1.0, D 2.0, two runtimes, plus a number of compilers. Any advice on a good combination to choose for starting out with the language and beginning a new project?

3
baryluk•

Compiler: DMD, works on Windows, and Linux, and now also on Mac OS X. Makes good code, and is reference implementation of D language. Next is GDC compiler, which is good for 64-bit, FreeBSD, ARM, etc, and if you really need full opensource toolchain. LDC is still very experimental.

Version of language: depends on your project, 1.x is stable, 2.x gets some new features, but they aren't very revolutioning (http://www.digitalmars.com/d/2.0/features2.html , http://en.wikipedia.org/wiki/D_(programming_language)#D_2.0 ), but can be usefull. Most of libraries supports only 1.x branch now.

Version of compiler: most recent one.

Runtime: If you are more familiar with C, then Phobos. If more with Java/C#, then Tango. Actually this also depends what libraries will be using. If any component will need Tango, then learn tango (it has "emulation" layer for phobos, called tangobos, and if you will use "phobos"-ish function's, then you will not even notice it).

3
[deleted]•

Thanks for the reply, that's helpful. I have to say it's a little frustrating for a noob. I just spent the last two hours trying to install some kind of working D system on my linux box and have yet to get hello.d to compile! I've tried dmd2, dmd1, gdc (from the ubuntu repository), the tango installer with dmd, dsss... but everything breaks at some point. It's pretty frustrating. I'm going to keep trying another day because I've looked at the language spec and I can see there's goodness there... but from a newcomer's perspective it's a pain in arse compared to say, the one-click Ruby or Python installers. Is it because I'm using linux? Are things a lot easier to set up on Windows?

3
baryluk•

Strange. If you are installing gdc from ubuntu repository, it should just work. Newbies many times have troubles with "object.di not found", but i don't think this is a point. I'm using linux (debian), and haven't got any big problems with dmd (my base compiler), dmd2 or gdc. I'm using phobos (always have some problems with Tango - it breaks my phobos configuration).

There are multiple ways to install dmd, on ubuntu you can try this

deb http://d.xk.pl/debian/ unstable contrib

and apt-get install dmd-nonfree (I will be happy to know about any problems beacuse I'm maintainer of it :D)

if it will not help join #d on irc.freenode.net :)

4
[deleted]•

I'd agree with most of what you say, except that GDC isn't that great, and LDC is actually very usable.

2
NinjaOxygen•

The was the killer for me - I started off using some OpenGL libraries that worked well with Phobos, then needed a couple of libs which used Tango too.

The resulting mess was horrendous! I gather that since I last touched it the release of Tangobos may alleviate my pain?

Edit: actually, I see in your post below you might have the same issue, with Tango breaking your Phobos!

1
NinjaOxygen•

I had exactly the same dilemma at the start of a new project I wanted to try out using D.

In the end, I got it working on top of Phobos, however once I tried to update it to newer libraries the whole mess no longer builds.

The amount of conflicting information out there, and the which build tools work with which libraries and how they should be installed caused me nightmares.

In the end, I do not have the time to spend wading through mailing lists trying to work out what is still current and what is not, what refers to Tango and what refers to Phobos, and why a whole bunch of stuff does not work with DSSS.

End result - I have stopped using D. When 2.0 is stable, and (hopefully) Tango becomes pretty standard, I will look at it again.

2
1100OP•

Does it look like the conflicting stdlib issue won't be a problem anymore?

1
baryluk•

I don't think so. This will only simplify things. You still will need to use http://www.dsource.org/projects/tango/wiki/TangobosInfo if you want both libraries to "coexist". Single druntime will additionaly improve compatibility between phobos and tangobos, or make it less probable.

1
baryluk•

It is for exampel for common garbage collection. And some basic functions. THis is already in 2.x branch from few weeks.

1
baryluk•

Also low-level support of threading and array handling will be done in druntime. Basicly druntime is a library (written in D), which methods calls are added implictly by compiler and called on som esituations like garbage collection, coping arrays, thread spawning, exception unroling, object deletion, synchronization.

One runtime common for Phobos and Tango will significantly improve in smaller number of bugs (only one project will need be updated, and both will gain up), better covarage and testing, and well defined area (so it will be easier to develop it, without messing with other aspects of library).

1