D and the world
Tom S
h3r3tic at remove.mat.uni.torun.pl
Wed May 2 16:17:40 PDT 2007
Walter Bright wrote:
> Tom S wrote:
>> First of all, thanks for all the feedback, guys :) It matters a lot to
>> us.
>
> I want to put together a slide on your project for my talk at the
> upcoming game developers' conference.
That'd be awesome :D And if you do, we won't hesitate to mention it on
our presentation either :>
>> It wouldn't be quite possible in any other language...
>
> Why? (I want to know, because I'll get asked this!)
I've written my share of C++, Java and Python code (as well as tried
other languages) and only D gives the right
runtimePerformance/codingEase ratio. When I write code in D (and I hear
it happens with other team members as well), it simply... compiles and runs.
Debugging is also trivial, especially when using the backtrace hack. DBC
and lots of non-release checks do the job really well. If the code
crashes, it crashes early and it's instantly visible where. The only
non-trivial problems are memory corruptions that can happen when playing
too much with pointers or deleting objects carelessly and escaping local
delegate contexts. With a bit of experience, these can be found quickly
as well, though.
On the other hand, if we coded in C++, we'd spend ages on constant
re-compilation, then deep within a debugger battle bugs which are
normally trivially caught by D's DBC. Templates would be terrible to
write, instead of the breeze that D yields. We'd have to use lots of
Boost, read 200-line error messages, and write at least 40% more code
just because the language needs us to. And for the 100th time when
someone on the team used a delete instead of delete[], I'd slash my
wrists. Just as with 'if (a = value)' or 'for ( ... ); {}'. Not to
mention that some stuff would be quite impossible, such as my custom
preprocessor for the rendering kernels/shaders.
Had we coded in Java, we'd have to be more careful about memory
allocations than in D or C++, use lots of hacks to make the resulting
code fast. Before the end of the project, we'd all have RSI because of
typing 'new' too many times. In the end, it would turn out that the
presentation PCs have JRE 1.5.0.1.3.5.3 instead of 1.5.0.1.3.5.4 which
our project was designed for and we'd have another reason not to believe
that Java is portable (as 2/3 of teams at the univ realize each year on
the team programming course).
As far as other languages are concerned, that'd be mix of the C++ and
Java horror scenarios, plus-minus performance implications that'd cause
the game to be too sluggish to be fun.
The only language better than D for game programming would be D coupled
with a dynamic lang, such as Io, Squirrel, Lua or Python.
> This is good stuff, mind if I quote you for my presentation?
Not at all :) *thinks* Woah I will be famous ;D *thinks*
> My talk will be on the 11th.
Aye! We'll share a video recording, will you ? :D
--
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode
More information about the Digitalmars-d
mailing list