tags:

views:

523

answers:

2

I'd like to try out the D programming language. I have simple pet project I've been meaning to finish and I thought it would be good opportunity to learn D 2.0.

However, my primary OS is kubuntu 64bit dual booting with Windows 7 64bit and I can't seem to get it to work. The project will use SDL and I suspect my 64 bit OS might be the issue.

What is the current state of affairs for D 64 bit? Does anyone have experience getting this to work?

BTW I have no interest in D 1.0, so it's D 2.0 or bust.

+13  A: 

At the moment, the answer is a resounding "it depends". Specifically, it depends on the OS and which version of D.

DMD, or the Digital Mars D compiler, is the reference implementation and offers absolutely no 64-bit support. Walter Bright, the language creator, has indicated that this is a high priority and he has every intention of adding support for this after D2 is finished. (D2 will be finished relatively soon, since Andrei Alexandrescu's book "The D Programming Language" is slated to be released soon.) However, he has indicated that due to linker issues, the first few versions will not support 64-bit on Windows.

For D1, 64-bit support is great on Linux and Mac if you use LDC, which is a D compiler targetting LLVM. For Windows, the GDC compiler, which targets the GCC back end, has been resurrected but is several versions behind the curve. On D1 this isn't terribly important since the language spec is fairly stable.

For D2, 64-bit support is currently basically non-existent. The aforementioned GDC does support it, but D2 has been evolving rapidly and GDC is too out of date to be useful here. Most non-trivial code written for version 2.015 (the latest GDC supports) probably won't even compile on version 2.040 (the latest version of DMD) and vice-versa.

Edit: As of today, June 21, 2010, there are some commits in SVN towards 64-bit support for DMD. These are far from a working compiler, but the point is that it's underway.

dsimcha
+2  A: 

As dsimcha has said, D2.0 you won't find a 64 bit compiler. However you can install the 32 bit dmd compiler to compile 32 bit programs in Linux. And you'll probably be using Derelict as your SDL wrapper.

Additional Packages Required

Update: Since the compiler is 32 bit you will need to install a 32 bit version of the SDL libraries. I don't think you will find them in the repository, so you will need to compile SDL yourself (you might be able to unpack the SDL .deb from the 32 bit repo and install them manually). Sorry I missed that would be an issue.

he_the_great
That link was golden. It got me a lot closer. I'm still stuck, however. The 32 bit executable doesn't want to load the SDL libraries.
caspin