Tag: D programming language

Gdc with dmd 2.015 frontend dstress results

D

It’s a while that this article have been a draft. Now i just have time to finish it. So here it’s!

Last week gdc was been ported to match the dmd frontend version 2.015. I’ve wrote in the newsgroup [news.digitalmars.com] about a way to test the gdc compiler. I didn’t obtain an answer by Walter Bright yet, maybe he didn’t look at it yet cuz he was busy releasing the new dmd version 2.033 and 2.034. It seems that for now the best way to test a d compiler is using dstress, a test suite of d programs. So i got tried to run dstress on my laptop, it was running from 10 hours when i decided to stop and make it run in a remote pentium dual core 64bit server. I’ve then contacted ChristianK, who work at the ldc compiler, and i asked him the script he used in formatting in html way the dstress output, like the dstress output for ldc. He gave me the script 🙂 So here is the dstress output of gdc 2.015. hope you will find it useful: http://vincenzo-ampolo.net/gdc/

As you can see, gdc is still far away to be a stable compiler but it’s moving, after its reborn, to be a good compiler.

There have been some hints on the digitalmars newsgroup about the integration of the compiler on the main gcc tree since a developer of gcc with committing rights. I’m working to make it possible. Unfortunately it’s not a good time for me due to my university exams.

D programming language reaches Intel

D

Andrei Alexandrescu, one of the people behind the development of the D programming language, have been interviewed by Intel in a 10 mins interview. He introduces the D programming language and shows the path which has been followed in designing the language.

You can also read the full article.

How to install Eclipse+Descent+Ldc D programming language compiler and configure auto completition

Dubuntu

Hi, i’ve just done a small video in how to being productive with the D programming language.

The video is actually on YouTube and shows, step by step, how to set up a perfect and complete IDE for the D programming language.

Hope you enjoy… See you!

Ldc D programming language compiler daily builds for ubuntu and debian

D

Hi,

From one week this program runs at midnight at my pc:

import tango.io.Stdout;
import tango.sys.Process;
import tango.time.WallClock;
import tango.text.convert.Format;
import tango.io.FileConduit;

int main(char[][] args)
{
auto fields = WallClock.toDate;
char[] pkgversion = Format.convert(“{:D4}{:D2}{:D2}”, fields.date.year, fields.date.month, fields.date.day);

auto p = new Process(“bash -c “rm -fr ldc-hg*””, null);
p.execute;
p.wait;
p = new Process(“hg clone http://hg.dsource.org/projects/ldc ldc”, null);
p.execute;
p.wait();
p = new Process(“rm -fr ldc/.hg”, null);
p.execute;
p.wait;
p = new Process(“rsync -r tango ldc/”, null);
p.execute;
p.wait;
p = new Process(“mv ldc ldc-hg-0.9.1~”~pkgversion~”+tango-0.99.8.dfsg”, null);
p.execute;
p.wait;
p = new Process(“tar -czf ldc-hg_0.9.1~”~pkgversion~”+tango-0.99.8.dfsg.orig.tar.gz ldc-hg-0.9.1~”~pkgversion~”+tango-0.99.8.dfsg”,null);
p.execute;
p.wait;
p = new Process(“rsync -r debian ldc-hg-0.9.1~”~pkgversion~”+tango-0.99.8.dfsg/”, null);
p.execute;
p.wait;

char[] changelog =
“ldc-hg (0.9.1~”~pkgversion~”+tango-0.99.8.dfsg-0ppa1) karmic; urgency=low

* Daily build of ldc hg

— Vincenzo Ampolo <[email protected]>  Thu, 30 Apr 2009 18:28:06 +0200n”;

auto fileChangelog = new FileConduit (“ldc-hg-0.9.1~”~pkgversion~”+tango-0.99.8.dfsg/debian/changelog”, FileConduit.WriteCreate);
fileChangelog.output.write(changelog);
fileChangelog.close;

return 0;
}

It’s a D programming language program that fetches ldc sources, add the tango library 0.99.8 to the source tree and create a valid soruce tree suitable for debuild -S and dput. Thanks to it i’m building every night packages of the ldc compiler which are stored in d-language-packagers ppa. To use it is very easy as you can read directly from the ldc project page in packages for ubuntu and debian section.

Feel free to contact me if something does not work correctly ! 🙂

ldc and libtango-gdc-dev packages for ubuntu/debian in ppa

Dubuntu

Hi, ldc and libtango-gdc-dev are in d language packagers ppa from some time ago now.

Here is the way you can install ldc 🙂 (the same applies for libtango-gdc-dev)

goshawk@earth:~$ sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xac6c83ad38a437abfc26a14af273e44ecde3fa2e
[sudo] password for goshawk:
Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 0xac6c83ad38a437abfc26a14af273e44ecde3fa2e
gpg: requesting key CDE3FA2E from hkp server keyserver.ubuntu.com
gpg: key CDE3FA2E: public key “Launchpad PPA for D Programming Language Applications Packagers” imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
goshawk@earth:~$ sudo nano /etc/apt/sources.list
goshawk@earth:~$ sudo apt-get update
Hit http://it.archive.ubuntu.com jaunty Release.gpg

[…]

Fetched 78.0kB in 1s (77.0kB/s)
Reading package lists… Done
goshawk@earth:~$ sudo apt-get install ldc
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libconfig++6
The following NEW packages will be installed:
ldc libconfig++6
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 7525kB of archives.
After this operation, 32.5MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://ppa.launchpad.net jaunty/main libconfig++6 1.3.1-1ubuntu1 [38.8kB]
Get:2 http://ppa.launchpad.net jaunty/main ldc 0.9.1~20090403.dfsg-0ubuntu2 [7486kB]
Fetched 7525kB in 7s (995kB/s)
Selecting previously deselected package libconfig++6.
(Reading database … 120004 files and directories currently installed.)
Unpacking libconfig++6 (from …/libconfig++6_1.3.1-1ubuntu1_amd64.deb) …
Selecting previously deselected package ldc.
Unpacking ldc (from …/ldc_0.9.1~20090403.dfsg-0ubuntu2_amd64.deb) …
Processing triggers for man-db …
Setting up libconfig++6 (1.3.1-1ubuntu1) …

Setting up ldc (0.9.1~20090403.dfsg-0ubuntu2) …
Processing triggers for libc6 …
ldconfig deferred processing now taking place
goshawk@earth:~$

Well, now you have ldc installed.

I just did a d program to fetch the lastest ldc trunk, package it, and put on ppa. I’m testing it in these days, and when my exams will finish (soon 🙂 ) daily packages will be available! 🙂

Bye.

Ldc: debian and ubuntu packages for x86 and x86_64 (amd64)

D

UPDATE:

To install the package on ubuntu, you need to install the libconfig++6 package from debian.

We are working to put ldc on debian and ubuntu.

In the meantime packages for x86 and x86_64 are ready and can be freely downloaded, you just need to install them and you can start compiling any source like in this example:

goshawk@earth:~/Documents/Projects/MOTU/ldc/d1/ldc$ sudo dpkg -i  ldc_0.9.1~20090403.dfsg-1_amd64.deb
Selecting previously deselected package ldc.
(Reading database … 236469 files and directories currently installed.)
Unpacking ldc (from ldc_0.9.1~20090403.dfsg-1_amd64.deb) …
Setting up ldc (0.9.1~20090403.dfsg-1) …
Processing triggers for man-db …
goshawk@earth:~/Documents/Projects/MOTU/ldc/d1/ldc$ cd
goshawk@earth:~$

goshawk@earth:~$ cat test.d
import  tango.io.Console;

void    main()
{
Cout(“Hello, World”).newline;
}

goshawk@earth:~$ ldc test.d
goshawk@earth:~$ ./test
Hello, World
goshawk@earth:~$

🙂

Ldc D compiler debian/ubuntu package

D

It’s two days that i’m spending time in my passion. The D programming language.

Well, from two months a new compiler is raising in the community talks. This compiler is ldc, is based on llvm and from the dmd frontend which is used as a main frontend to implement the D specifications.

As i said some time ago, one of the things that makes D incomplete is a full free software compiler. Well. Ldc could be the answer. I started packaging ldc for debian and ubuntu creating a branch or revision 1179 from the ldc hg repository. As a standard library i used tango at its early release 0.99.8. The sources of my work are on launchpad.net and they include a full working tree, already with a debian directory in it.

There are still some things to fix which i’ve reported to the d-language-packagers group with the above mail:

Hi.

In these days i worked in packaging ldc.

In the launchpad bzr of the group you can already find a revision which
compiles quite good. This is the content of the package:

goshawk@earth:~/Documents/Projects/MOTU/ldc/d1$ dpkg -c  ldc_0.9-1_amd64.deb
drwxr-xr-x root/root         0 2009-03-30 20:35 ./
drwxr-xr-x root/root         0 2009-03-30 20:35 ./usr/
drwxr-xr-x root/root         0 2009-03-30 20:35 ./usr/sbin/
drwxr-xr-x root/root         0 2009-03-30 20:35 ./usr/bin/
-rwxr-xr-x root/root       721 2009-03-30 20:32 ./usr/bin/ldc.conf
-rwxr-xr-x root/root       305 2009-03-30 20:32 ./usr/bin/ldc.rebuild.conf
-rwxr-xr-x root/root  12266952 2009-03-30 20:35 ./usr/bin/ldc
drwxr-xr-x root/root         0 2009-03-30 20:35 ./usr/lib/
-rw-r–r– root/root    742780 2009-03-30 20:35 ./usr/lib/libtango-base-ldc.a
-rw-r–r– root/root   7084206 2009-03-30 20:35 ./usr/lib/libtango-user-ldc.a
drwxr-xr-x root/root         0 2009-03-30 20:35 ./usr/share/
drwxr-xr-x root/root         0 2009-03-30 20:35 ./usr/share/doc/
drwxr-xr-x root/root         0 2009-03-30 20:35 ./usr/share/doc/ldc/
-rw-r–r– root/root       279 2009-03-30 02:33 ./usr/share/doc/ldc/readme.txt
-rw-r–r– root/root      2304 2009-03-30 02:33
./usr/share/doc/ldc/CMakeLists.txt.gz
-rw-r–r– root/root     14815 2009-03-30 02:07 ./usr/share/doc/ldc/copyright
-rw-r–r– root/root       154 2009-03-30 17:56
./usr/share/doc/ldc/changelog.Debian.gz

As you can see, all the .conf should be moved in /etc/.  Arthur, do you think
that putting them in /etc/ldc/ is the better choice?

What’s missed to make ldc working away from the building environment is
explained by the ldc config file:

default:
{
// ‘switches’ holds array of string that are appends to the command line
// arguments before they are parsed.
switches = [
“-I/home/goshawk/Documents/Projects/MOTU/ldc/d1/ldc-0.9/obj-x86_64-
linux-gnu/runtime/../tango”,
“-I/home/goshawk/Documents/Projects/MOTU/ldc/d1/ldc-0.9/obj-x86_64-
linux-gnu/runtime/../tango/lib/common”,
“-L-L/usr/lib”,
“-d-version=Tango”,
“-defaultlib=tango-base-ldc”,
“-L-ltango-user-ldc”,
“-debuglib=tango-base-ldc”
];
};

The missing point is the tango library that should be compiled for ldc IMHO.
I think that the best solution is to provide a libtango-ldc and libtango-ldc-
dev package to contain the .a and the .di files used by ldc.

Any comment or suggestions about it?

Best Regards.

See you.

If you have any suggestion about it, just comment on this post 🙂

Let’s see what happens in the next days, if you want to contribute, join the the d-language-packagers group and send me a comment! 🙂

D programmin language programs available for ubuntu: dsss and libtango

D

Hi,

On december 08 i worked to make a better support in ubuntu linux of the D programming language which is the successor of the C programming language IMHO.

If it’s so powerful as i say why isn’t it used like the C language?

  1. it’s quite new, and there is just one book about this language and it’s name is Learn to Tango with D which i bought in pdf version for less than 11€
  2. There is no a standard library: there are two libraries phobos and tango. phobos is supported by Walter Bright which is the D programming language creator and it’s seems to be not too much powerful and it’s very lite. Tango is community supported, it has a book about it, it seems very powerful and does not need to much space, it’s written in D and it’s used by a lot of programs.
  3. Lack of free (read as full GPL) compiler
  4. No integration in Gnu linux distributions

Well, these are for me the big pitfails of the D language. While the 1 issue is solved by time the issues 2 and 3 are the most important ones that should be solved soon as possible to spread the D usage.

For issue 3 and 4 i thought i could do something. And i started working. We did a group in launchpad.net and we started working. Right now we packaged dsss and libtango for ubuntu. In ubuntu and debian there is the gdc compiler which seems to be no longer updated and there are some bugs still opened. The libtango and dsss packages we created are designed to work with gdc packages in ubuntu and debian. To start programming in D on ubuntu or debian you have just do edit your /etc/apt/sources.list and add the following lines:

deb http://ppa.launchpad.net/d-language-packagers/ubuntu jaunty main

Then install the dsss and libtango package with:

sudo aptitude update && sudo aptitude install dsss libtango

Then you can start making your own D program and save it (eg program.d). To compile just do:

gdc -fversion=Posix -I /usr/include/d -L/usr/lib/tango/ program.d -lgtango

And your program will be compiled, just execute the result a.out to see your program running.

For issue 3 i’m still working on it 🙂

%d bloggers like this: