Jump to content
  • Advertisement
Sign in to follow this  
Dolf

The D programming language

This topic is 3256 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I've been using C++ for quite some time now and I thought it might be handy to have some cross-language experience. Both for growing as a programmer and using that experience in C++ and for not turning into a dinosaur stuck with an old language. So I've been looking into D and it sounds really interesting, but I haven't been able to find any advanced tutorials. What are your thoughts on the future? Will D or C# be interesting for games? I haven't found a lot of middle ware that works with D, only something called "Derelict", but I guess that can change if it gains popularity by being really good. Andrei Alexandrescu, who is a C++ guru, shared some thoughts on the topic: http://www.ddj.com/hpc-high-performance-computing/217801225 He also wrote a book about it, I might buy it if I can't find any proper tutorials. Do you guys have any experience with D? How do you think D can relate to games? From what I read, it's like C++ but better designed, and therefore more productive. But you can still get your hands all dirty with pointer magic and disable the memory manager if you see an opportunity where you can outperform the garbage collector. PS. Yes, I would enjoy an interesting discussion on the pro's and con's of the languages.

Share this post


Link to post
Share on other sites
Advertisement
Oooo it's time for our regular D thread.

D has been around for ages now, pre-.Net it might have had a point, now I feel less so.

Your comment about the libs is a telling one; "if it can become popular". So far it's failed to.

It's like the year of the linux desktop; every year someone will claim that this! this is the year!

And yet each time the world spins on and it doesn't happen...

Share this post


Link to post
Share on other sites
Quote:
Original post by Dolf
I've been using C++ for quite some time now and I thought it might be handy to have some cross-language experience.

May I suggest learning Haskell or Clojure then? D might be too similar to C++.

Quote:
Original post by Dolf
[Andrei Alexandrescu] also wrote a book about it, I might buy it if I can't find any proper tutorials.

I am definitely going to buy it. I'm just into languages in general. Always nice to try new toys:

int[] arr = [ 1, 3, 4, 2 ];
sort!("a > b")(arr); // <--- SEXY AS HELL
foreach (i; arr) writeln(i);

Share this post


Link to post
Share on other sites
Quote:
Original post by Dolf

cross-language experience.
Quote:
Both for growing as a programmer
Quote:
not turning into a dinosaur stuck with an old language.


D is a dialect. So is C#, Java, C, .... They are all a family of C languages and all follow the imperative paradigm. If you know one, you know all.

All of these are basically dinosaur languages.

Today, functional languages are the brave new world and the future (Lisp people sigh deeply).

Also, javascript and Ruby.

Quote:
and therefore more productive.

Productivity comes primarily from middleware or standard library (Java-like, everything and kitchen sink), community and adoption. Language itself has surprisingly little to do with it.

Share this post


Link to post
Share on other sites
Maybe I'm a bit C++ biased but honestly I think C++ is underutilized. I'd rather see better written functions and more readable C++ code then argue over semantic tricks or benifits of 80% C++ language with 30% different quirks. For instance wouldn't it be nice to see more Unicode used. I found for instance if you use a unicode input tool such as unicodeinput.exe you can substitute π instead of D3DX_PI in your coding definations with a quick define header. So code like area=πr2 becomes really easy to understand which is really the goal of high level languages anyways.

Also when I see a sort in haskal when sort definitions have already been written I ask why reinvent the wheel(as I'm guilty of that myself).

As for .net you can mix the clr in C++ which is also nice and get the benefits of both traditional C++ and .NET.






Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
Quote:
and therefore more productive.

Productivity comes primarily from middleware or standard library (Java-like, everything and kitchen sink), community and adoption. Language itself has surprisingly little to do with it.

And from good tool support (although maybe you grouped that under middleware). IMHO that's always been D's greatest failing - easy interop with C and C++ meant there were plenty of libraries usable from D, but there were never any good IDEs that I saw.

Share this post


Link to post
Share on other sites
Quote:
Original post by ptroen
As for .net you can mix the clr in C++ which is also nice and get the benefits of both traditional C++ and .NET.
I have seventy thousand lines of C++/CLI code sitting in front of me, forming a production library. The only thing "nice" about it is the sheer incredible achievement that it works at all. Useful yes; nice, not a chance.

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
Quote:
Original post by Dolf
I've been using C++ for quite some time now and I thought it might be handy to have some cross-language experience.

May I suggest learning Haskell or Clojure then? D might be too similar to C++.


I second both of those suggestions. Also consider picking up any of the other Lisp dialects, Smalltalk, Prolog, Forth, or APL - all of which will be quite mind-expanding for someone used to C++.

Quote:
Original post by ptroen
Also when I see a sort in haskal when sort definitions have already been written I ask why reinvent the wheel(as I'm guilty of that myself).


You were probably looking at a code sample meant to showcase the language, and that's what a code sample is; a short snippet showing how to accomplish a common task. The rationale behind showing people these samples is, if the language can replace 20 lines of C code with 2, think of what it could do to a codebase with hundreds of thousands of lines.

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
And from good tool support (although maybe you grouped that under middleware).


IMHO, tool support isn't strictly needed. javascript, Python and Ruby on Rails are all example of it. javascript hasn't had a decent debugger for years, Python got hold in academia, where IDEs are considered blasphemy. These days, many of new languages get quick support on JVM in either NetBeans or Eclipse, so this barrier has been lowered considerably, or completely eliminated (repository and general project management).

IDEs are important for very UI centric applications. Delphi and its legacy in .Net are great examples of that, Visual FoxPro is another. This is where VS and NetBeans made a huge difference. They tend to be relevant for business development, since they prove suitable for non-programmers, or at very least for non-dedicated programmers.

Conversely, as far as web apps go, UI tools have historically proven to be a dead end, and even the infrastructure has often been very rudimentary. Again, Eclipse helps to bridge the gap here for relatively low cost, with the myriad of other tools.

And then there's still the whole Emacs and vi crowd when it comes to C and C++.

Share this post


Link to post
Share on other sites
Quote:
Original post by Antheus
Quote:
Original post by OrangyTang
And from good tool support (although maybe you grouped that under middleware).


IMHO, tool support isn't strictly needed. javascript, Python and Ruby on Rails are all example of it. javascript hasn't had a decent debugger for years, Python got hold in academia, where IDEs are considered blasphemy.

True, you can get away without "big" tools like Eclipse and VS for languages which are looser with their types. But for strong, statically typed languages (which IMHO D falls under) you need a good IDE to be productive. Otherwise you waste huge amounts of time everytime you want to make even a trivial refactoring.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!