Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Experiences with D-programming-language [closed]

Tags:

d

Has someone here ever had experience with the D programming language?

It seems to have many nice features but will it ever reach the popularity of those currently widespread languages like C++, Java or C#?

So is it worth learning or is it an isolated language with minor prospects.

like image 356
Dario Avatar asked May 26 '09 08:05

Dario


People also ask

Why D programming language is not popular?

it lacks good marketing; it doesn't have a high-profile corporate backer. it lacks compelling technical merit; there is nothing particularly special about it. it's too difficult to learn; it present too steep a learning curve. it's too big and complex; nobody likes big, complex languages.

Is the D programming language good?

D code is easy to understand by anyone familiar with C-like programming languages. Moreover, D is very readable, even for sophisticated code, which makes bugs easy to spot. Readability is also critical for engaging contributors, which is key to the growth of open source software.

How fast is the D programming language?

D: 18.9 s [see below for final runtime] C++: 3.8 s.


1 Answers

I spent a few days playing with D to see how it compares to C++ and java. It is positioned as another way to achieve the same things C++ does, but without all the undefined behaviour, and with the addition of a garbage collector, foreach loop, and some other modern niceties. It compiles to native code so you get access to all the usual optimisations that can occur from this scenario.

The entire C language is encapsulated as a subset of D as the lower level building blocks from which much of the language is constructed. This can help with portability, but also prevents D from evolving into single consistent methodology.

The ability to run any C function natively in D opens up the realm of possibility to include systems programming - operating systems, drivers, etc.

There are two commonly used class frameworks in D. The default is Phobos, which is rather spartan and simple in design, allowing you to create the structures you need, but providing few large or complex building blocks. The other is Tango, which is reminiscent of the java class library and contains a much more complete framework. There is also a project to allow interoperability of the two libraries.

In my experience, D is quite a nice language for coding, having a lot in common with C# and java, and allowing access to the raw machinery through C and even assembly interop. The main limitation I see is a lack of good development tools support. There are some IDEs and plugins out there, but nothing very complete, so you might be better off with a text editor and a command line build tool in the meantime.

There are two versions of the language, D1 and D2. D1 is better supported by frameworks and compilers for now, and D2 has added a few convenience features that make the language easier to deal with and use.

Update (June 2009): I have recently been looking into D again and thought I should draw attention to DSource, which now has a number of different compiler projects, and is the home of the Tango library, various bindings, several GUI toolkits, and a couple of IDEs. Some of the projects were abandoned in their infancy, but I believe there are quite a few going strong today, and making good progress. At this stage, it looks very much like the success of D will be determined by the open source movement far more than by its progenitors.

Update (February 2012) While I haven't looked much at D since my last edit, I will note that D2 is out now, with the support of a great book, The D Programming Language. Typical of Alexandrescu, it exposes a lot of detail of the template system, including template constraints, which make D a much more expressive and type-safe tool than the current state of C++.

Other than reading the book, I have had no contact with the D language or its tools and community since 2009 so I can't comment on their maturation or growth to date. I am aware of a small cadre of professional programmers that wish they were allowed to use the language at work, but most of us are generally stuck with C++ and other popular languages in the areas where D should be at its best.

like image 164
Ian Gilham Avatar answered Oct 21 '22 16:10

Ian Gilham