Sign in to follow this  
stephenfx

What do you think of the D language?

Recommended Posts

stephenfx    122
It is an exciting language for me. It is a system level programming with garbage collection and many other features. Is there anyone using it for game programming? I can’t keep myself from try it! It’s just what I need. If you had never heard about D, please take a look at: http://www.digitalmars.com/d/index.html

Share this post


Link to post
Share on other sites
robotichrist    193
I've been using it for awhile now and so far I like it. Even though the current standard library is a bit rough it is still more than usable for games. Here is a game I wrote for a school project using D:
http://www.csl.mtu.edu/cs3141/project/group2/www/

And I have several other simple examples on my website:
http://assertfalse.com/

If you want to do anything game related, I highly recommend you check out the Derelict bindings:
http://www.dsource.org/projects/derelict

Share this post


Link to post
Share on other sites
Alpha_ProgDes    6921
Quote:
Original post by smr
It's ok, but IMO .NET is better. And yes, I've tinkered enough with D to know.

For the uneducated how so? And are you comparing D to the whole .NET framework or just say C#?

For the record, I'm uneducated so I come here to learn [smile]

Share this post


Link to post
Share on other sites
amnesiasoft    161
It seems to be a pretty nice language so far, I imagine after it has matured a bit (what's it at, 0.69?) it'll be a very good language. Also, a decent IDE would be likely to increase its popularity a lot (sure you can use C::B, but it takes too much effort to set up)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
i don't think much of it... err... rather not at all. i've had one primary programming language, C/C++, for the last 14 years (I started using C++ before any compiler even had templates!), and am now learning C# (the .NET 2.0 FCL is much better than the 1.X versions so I think it's finally a good time to learn C# now and so far I'm enjoying it).

when it comes to learning new languages the first things i worry about are... "is it going to get me a job?", "is it going to keep me employed?", and "will i still be using it 10 years from now?" i don't think D satisfies any of those so not yet, but maybe in the future?

Y-Go

Share this post


Link to post
Share on other sites
cignox1    735
I never used it and since I have another couple of languages to learn before D, then I wont use it soon, but the features list is pretty nice and some of them are those I would expect to see in the C++, if only they updated it.

Share this post


Link to post
Share on other sites
nmi    978
Quote:
Original post by amnesiasoft
It seems to be a pretty nice language so far, I imagine after it has matured a bit (what's it at, 0.69?) it'll be a very good language. Also, a decent IDE would be likely to increase its popularity a lot (sure you can use C::B, but it takes too much effort to set up)


There is an eclipse plugin called DDT at this site:
http://www.dsource.org/projects/ddt

However it was not updated for 5 months. Maybe the programmer there needs some help ?

Share this post


Link to post
Share on other sites
Nitage    1107
It's got a lot of features I'd expect in an improved C++ but, for reasons passing understanding, they've also removed some features:


  • The = operator can no longer be overloaded - so correct reference counting can't be implemented. They argue that it's unnecessary in a garbage collected language, however, they've overlooked the fact that it's sometimes necessary to manage resources other than memory - in paticular sometimes you need resources to be destoyed when they're finished with, not at some non-deterministic point after they're finished with)

  • They've removed const. The argue that it 'adds nothing' seeing as it can be circumvented via const_cast.I notice the language still uses static typing thoughm even though it 'adds nothing' due to reinterpret_cast



C++ serves me very well as a statically types compiled language - I'd be happy to upgrade to something better in every respect, but I can't be bothered with a 2 steps forward, 1 step back approach.

Share this post


Link to post
Share on other sites
manuelb    152
Quote:
Original post by Anonymous Poster
i don't think much of it... err... rather not at all. i've had one primary programming language, C/C++, for the last 14 years (I started using C++ before any compiler even had templates!), and am now learning C# (the .NET 2.0 FCL is much better than the 1.X versions so I think it's finally a good time to learn C# now and so far I'm enjoying it).

when it comes to learning new languages the first things i worry about are... "is it going to get me a job?", "is it going to keep me employed?", and "will i still be using it 10 years from now?" i don't think D satisfies any of those so not yet, but maybe in the future?

Y-Go



well, I've being working as a system analist and programmer for 7 years, when it comes to learning new languages the first thing i worry about is.. "is it cool?" Well, I have to learn a new language on the fly almost every new project I start, so, when I can decide witch language to learn I choose the cool ones.

Share this post


Link to post
Share on other sites
nmi    978
Quote:
Original post by Nitage
The = operator can no longer be overloaded - so correct reference counting can't be implemented. They argue that it's unnecessary in a garbage collected language, however, they've overlooked the fact that it's sometimes necessary to manage resources other than memory - in paticular sometimes you need resources to be destoyed when they're finished with, not at some non-deterministic point after they're finished with)

Maybe the inventor of D was not aware of this fact. However you can use the 'auto' keyword to achieve RAII, i.e. destroy the object when it goes out of scope (and trigger freeing of resources).

Quote:

They've removed const. The argue that it 'adds nothing' seeing as it can be circumvented via const_cast.I notice the language still uses static typing thoughm even though it 'adds nothing' due to reinterpret_cast

You mean 'const' in the declaration of function parameters ?
At least it seems possible to use const as attribute of variables:
http://www.digitalmars.com/d/attribute.html
http://www.digitalmars.com/d/declaration.html

Quote:

C++ serves me very well as a statically types compiled language - I'd be happy to upgrade to something better in every respect, but I can't be bothered with a 2 steps forward, 1 step back approach.

That's effectivly one step ahead. There is also a forum on the digital mars site where you may give comments or suggest improvements.

Share this post


Link to post
Share on other sites
Nitage    1107
Quote:
Original post by nmi
Quote:

They've removed const. The argue that it 'adds nothing' seeing as it can be circumvented via const_cast.I notice the language still uses static typing thoughm even though it 'adds nothing' due to reinterpret_cast

You mean 'const' in the declaration of function parameters ?
At least it seems possible to use const as attribute of variables:
http://www.digitalmars.com/d/attribute.html
http://www.digitalmars.com/d/declaration.html


Look more carefully:
Quote:
The const attribute declares constants that can be evaluated at compile time.


It isn't possible to declare a parameter as const (meaning 'this function will not alter this parameter'). You can declare a constant variable in D, but you can't create any kind of a const reference to a variable.


Share this post


Link to post
Share on other sites
smr    2468
Quote:
Original post by Alpha_ProgDes
Quote:
Original post by smr
It's ok, but IMO .NET is better. And yes, I've tinkered enough with D to know.

For the uneducated how so? And are you comparing D to the whole .NET framework or just say C#?

For the record, I'm uneducated so I come here to learn [smile]


D's runtime library, phobos, stinks. I believe that there exists a group who have taken it upon themselves to write a replacement for it. Maybe I'll give it a go after that materializes. The .NET framework is much more complete and much more stable, in the sense that you don't have to worry about it changing between minor versions.


Share this post


Link to post
Share on other sites
stephenfx    122
Quote:
Original post by robotichrist
I've been using it for awhile now and so far I like it. Even though the current standard library is a bit rough it is still more than usable for games. Here is a game I wrote for a school project using D:
http://www.csl.mtu.edu/cs3141/project/group2/www/

And I have several other simple examples on my website:
http://assertfalse.com/

If you want to do anything game related, I highly recommend you check out the Derelict bindings:
http://www.dsource.org/projects/derelict


hello,
Which debugger are you using? I have tried Visual studio. I can step in the source file lines, and the call stack is shown, but the variable is not shown correctly. I can’t find a full function debugger for D.

Share this post


Link to post
Share on other sites
Telastyn    3777
Maybe for you (OP), but not for most of the world. If I'm doing system level programming, I want something mature and with good library/documentation/community support. C/C++ are there, D is not. If I want something better than C++, I don't want system level programming, and I don't want something which still ties itself to C.

Share this post


Link to post
Share on other sites
snk_kid    1312
Instead of wasting everyone one's time you can read this thread where the clueless D community talk behind my back (in there mailing list), misunderstand me and call me a "C++ fanboy" (which is so wrong i don't know where to begin). Furthermore there response to my posts (and some others) where unconvincing or never answered all questions/issues raised.

Share this post


Link to post
Share on other sites
manuelb    152
Quote:
Original post by snk_kid
...misunderstand me and call me a "C++ fanboy"...


but of-corse you're a SNK fanboy :).
hehehe, sorry for the off-topic, I couldn't resist.
By the way, I'm a SNK fanboy too.

Share this post


Link to post
Share on other sites
clayasaurus    139
I'm developing a 2D Game library in D and I like it :-P

I see nothing wrong with D but I know that if I do, the language creator is very open to suggestions and criticisms.

As for problems with the standard library, most of the usual things you would need a standard library for are built-in to the language itself.

I think D lends itself to game programming very well, and if you want to see a successful conversion from C++ project to D look at shorthike http://www.shorthike.com/ http://www.shorthike.com/trac

Share this post


Link to post
Share on other sites
Sneftel    1788
D tries to fix the shortcomings of C++ by adding new language features. This is a little bit like trying to fix a wrecked '53 Volkswagen by adding fins and a periscope.

Share this post


Link to post
Share on other sites
ToohrVyk    1595
Quote:
Original post by Sneftel
D tries to fix the shortcomings of C++ by adding new language features. This is a little bit like trying to fix a wrecked '53 Volkswagen by adding fins and a periscope.


A clever comparison. I myself have never found an use for D — when I can afford not to use C++, I'll use another language, such as C# or O'Caml or Prolog, and when I have to use C++, well, I just have to.

Share this post


Link to post
Share on other sites
Rebooted    612
Quote:
Original post by ToohrVyk
A clever comparison. I myself have never found an use for D — when I can afford not to use C++, I'll use another language, such as C# or O'Caml or Prolog, and when I have to use C++, well, I just have to.
Exactly my thoughts. Nothing really wrong with D as such.

Share this post


Link to post
Share on other sites
clayasaurus    139
The whole purpose of D is to make programming _easier_. You can write the same code in C++ with 100 files and 10,000 lines, or the same program in D with 50 files and 7,000 lines (assuming 3,000 lines are simply class definitions and function prototypes). You can compile large D projects without makefiles ( http://www.dsource.org/projects/build ), and large projects only take a couple of seconds to compile. You can use it as a scripting language alternative in *nix ( http://digitalmars.com/d/rdmd.html ).

It is a misconception that D is equal to C++ with more features. Rather, some features are added (template metaprogramming ( http://digitalmars.com/d/templates-revisited.html ), lazy evaluation of function arguments ( http://digitalmars.com/d/lazy-evaluation.html ), exception safe programming ( http://digitalmars.com/d/exception-safe.html ), and memory management ( http://digitalmars.com/d/memory.html ) and some are subtracted such as the C Macro language and other support of legacy C code.

Some features are refined, like the ability to have real typedef's, modules (which reduce project size by 50% compared to C++), built in arrays and strings, delegates instead of function pointers, and not having to use the rely on pointers, or when there are pointers they don't have their own special '->' syntax, rather just '.'

To show off the metaprogramming capabilities of D, look at a compile time raytracer program here http://www-users.mat.uni.torun.pl/~h3r3tic/ctrace/ .

The reason you would use D over Java and C# is because D is much faster not having to rely on a VM and gives access to assembly within the D language itself, not relying on the backing of a large corporate interest (less political issues), open to suggestions and improvements, but most importantly are the huge productivity boosts of dealing with a refined language rather than a clunky one.

The reason D does fall short is only because there are less libraries available for D than C++, which has nothing to do with the language itself but only goes to show that currently the D community is small. In order to overcome this obstacle, D gives access to the C language which does make it possible to bind D to C and C++ code. C++ code binding is a little bit harder but there are tools available to automatically do this for you, and there are also tools to automatically turn C .h files into .d files which allows you to access C functions within D.

Share this post


Link to post
Share on other sites
ToohrVyk    1595
Quote:
The reason you would use D over Java and C# is because D is much faster not having to rely on a VM.


You seem to be a decade late. Both Java and C# use JIT compiling now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this