Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How well does D support 64 bit?

Tags:

64-bit

d

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.

like image 973
deft_code Avatar asked Mar 04 '10 04:03

deft_code


2 Answers

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 64-bit support. The 64bit support is restively new (see comments below) but Walter Bright, the language creator, has indicated that getting it on par with 32bit is a high priority now that D2 out the door (or more correctly now that Andrei Alexandrescu's book "The D Programming Language" has been released). However, he has indicated that due to linker issues, the first few versions will not support 64-bit on Windows (this seems to still be true).

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.

Edit # 2: As of mid-February, 2011, DMD 2.052 supports 64-bit on Linux.

Edit # 3: As of November, 2011, GDC is usable and only one release behind DMD, though it's somewhat beta-ish and not packaged yet. You have to compile it from source.

like image 78
dsimcha Avatar answered Sep 25 '22 19:09

dsimcha


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.

like image 34
he_the_great Avatar answered Sep 24 '22 19:09

he_the_great