Sunday, November 6, 2011

Digitalmars D version 2 a fresh look

A few years ago I spotted the D language and was quite impressed by it, although the division of standard library, the development of a new 2.0 version and the stale state of many libraries stopped from active usage of it.

Now a lot of things changed, the 2.0 version is more or less stable and there's a GNU D compiler for this version and it's actively developed/supported, and even planned to be maintained as one of the GNU Compiler Collection. I wish it come true.

Having reviewed the specs for the D 2.0 I should admit that the language is engineered VERY thoroughly, with many features I was missing in Java and C++, it's clean and rich at the same time.

At first I was planning to use LDC compiler for D 1.0 because failed to compile GDC for MacOSX, but then I decided to start coding something useful for Linux only to study the language, and probably later there will be a viable implementation for MacOSX. The official implementation (DMD) can compile only 32-bit binaries for MacOSX, that's why I'm concerned on alternative implementations like GDC, LDC2...

Here's the link to the site:

http://www.d-programming-language.org
http://www.digitalmars.com

Wednesday, November 2, 2011

LDC under ubuntu 11.10 one more try

Installed through apt llvm-2.9, downloaded trunk LDC, executed ccmake, and added -ldl to LIBCONFIG_LDFLAGS. Successfully built!

Build tango, and adjusted /usr/local/etc/ldc.conf:

// This configuration file uses libconfig.
// See http://www.hyperrealm.com/libconfig/ for syntax details.

// Special macros:
// %%ldcbinarypath%%
//  - is replaced with the path to the directory holding the ldc executable

// The default group is required
default:
{
    // 'switches' holds array of string that are appends to the command line
    // arguments before they are parsed.
    switches = [
        "-I/usr/local/include/d",
        "-I/usr/local/include/d/tango/core/vendor",
        "-L-L/usr/local/lib",
        "-L-ltango-ldc",
        "-d-version=Tango",
        "-defaultlib=tango-ldc",
        "-debuglib=tango-ldc"
    ];
};

Tuesday, November 1, 2011

LDC under Ubuntu 11.10

Install llvm 2.9 from repo, ccmake, specify path to llvm-config tool: /usr/lib/llvm-2.9/bin/llvm-config, finally was unable to build from sources. :(