Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The D Programming Language for Game Development [closed]

Tags:

d

Recently I've been bothered because I reached a point in which C++ (even 0x) felt very limited, so I started looking for alternatives.

Forget Java, C#, Python or Ruby. I still like the low-level nature of C++ and I'm not fond of virtual machines. Further, I'm a game engine developer, so I have to develop core routines which must be really fast, and lately I've been hungry for code expressiveness. C++ is an almost-there language for me, but there are many exceptions on how to use templates, and GCC isn't optimizing stuff as well as I'd hoped it would.

So I'm considering to start learning D.

Do you think it will suffice my needs as a game developer? I'm wary because I've never heard of D being used for that.

Thanks!

like image 679
Gui Prá Avatar asked Dec 23 '10 06:12

Gui Prá


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.

Which programming language is used in game development?

C++ is the most popular language for creating game engines —the development environments where game programmers create and host their interactive worlds. Game engines provide the technology for every aspect of a game, from graphics, physics, and sound to the behavior of AI-powered game bots.


2 Answers

I used D 1.x for doing games and demos, some of them are public domain open source (A, B, C, D, E).

D can give you productivity unheard of in C++-land if you are willing to pay the high-price of arguing with everyone about why do you use D.

If you go this route, i advise you to pick D 2.x, Derelict and Visual D (hint for future readers: this is 2011).

As for game development :

  • the D GC is not a real problem. It is if you allocate too much in a frame, but that's about it. The classic methods of pooling, reusing, etc... work.

  • you can write x86 assembly portably across Linux, Mac & Windows. Also static if allows pretty fun templated naked assembly functions.

  • inlining across module boundaries is working without a "link time optimization" switch

  • I find it easier to maintain debug and release version (compared to C++)

  • avoid new features and choose compilers conservatively... just like in C++

like image 104
ponce Avatar answered Sep 22 '22 07:09

ponce


Kenta Cho uses D and Simple DirectMedia Layer(SDL) to develop his Windows games. They're a lot of fun. Take a look for inspiration and source:

  • Titanion
  • Torus Trooper
  • Gunroar
like image 45
Corbin March Avatar answered Sep 20 '22 07:09

Corbin March