D and the world

Daniel Keep daniel.keep.lists at gmail.com
Sat Apr 28 06:03:47 PDT 2007



Michael P wrote:
> Is there really any benefits using scripted languages besides not having to compile? D is much faster than most scripted languages and it compiles fast and have a garbage collector. I myself find D easier and you get better performance!
> "While the C++ parts of the engine are fast, UnrealScript is a relatively slow language to execute."
> It's a sad thing when ppl underestimate the advantages of good performance. Bump mapping could be done with an Amiga (demo but still). And if you install Win98 on a new machine it will fly! 

I'm throwing my money in with Gregor on this, but I thought I'd share
one of my experiences with Python.

I argued for, and eventually managed to bludgeon my other project
members into using Python for our third year group project at uni.  I
can't speak for the others, but I think that Python's dynamicism (;P)
really made the thing easier to write.

For instance, because we were all working on different components in the
program, I designed a centralised message-passing gateway to link them
all together.  As the project grew, the message passing system went from

msgSink.getMessage('GetSelection').send()

To

msgSink['GetSelection'].send()

To

msgSink.GetSelection()

It also grew all kinds of cool stuff like the ability to directly hook a
function into the messaging system like this:

@attach_to("GetSelection", "before-call")
def BeforeGetSelection():
    # Do something

We implemented a whole Undo/Redo system by hooking into state change
messages, and pushing the inverse operation onto a stack.  We didn't
need to touch a single line of code to do it; we just loaded in the
"Undo" shadow objects and it worked.

Even cooler was when I hacked an interactive Python shell directly into
the program to use for debugging.  If there was something acting up, we
fired up the debugger window, and starting manually playing with the
program's guts.

D is a great language, certainly a huge step up from C and C++, but
frankly it can't hold a candle to what Python's capable of in terms of
dynamicism.

Not yet, anyway.

	-- Daniel

P.S.  That's four times.  We should be getting a letter from Oxford
pretty soon ;)

-- 
int getRandomNumber()
{
    return 4; // chosen by fair dice roll.
              // guaranteed to be random.
}

http://xkcd.com/

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/



More information about the Digitalmars-d mailing list