[gameprogrammer] Re: Fast development over multiple platforms, which language?

  • From: brianevans <brianevans@xxxxxxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Mon, 07 Mar 2005 16:10:14 -0600

>I've noticed that people who say Java code is necessarily slower than
>C/C++ code often also say the same thing about truly interpreted
>languages like Perl, Python, etc.  (By the way Java not quite the same
>thing as an interpreted language).

Yes, Bob set me straight on that one.  I knew it compiled to bytecode, but 
was mistaken in assuming that Java always interprets that bytecode.  So in 
my head that put it in the 'interpreted class' of languages.

And yes you're right I would say that 'interpreted class' languages are 
necessarily slower than native code, the quality of the code being equal.

>It's a common misconception that
>interpreted languages are significantly slower than compiled ones.  The
>main reason for that I think is that interpreted languages simply make
>it easier for programmers to write horribly inefficient code.  They can
>handle lots of inconveniences behind the scenes, often at a cost, but
>that doesn't mean you can't write fast code in those languages.  If the
>interpreters are written decently (as I'm sure most agree Perl and
>Python are), reasonably fast code can be written in any language.  If
>you're depending on the interpreter/compiler to make your code fast,
>you're not writing efficient code :)

Well, I don't mean that interpreted-class languages are effectively too 
slow or inefficient at all.  I guess my claim is that in just about every 
case you can write native code (C/C++) that executes faster.  No doubt you 
can do some really amazing things with very little effort in interpreted 
languages.  And with CPU's as fast as they are, that will be sufficient for 
all but the most performance starved applications.

>Related to that, no matter what language you choose, it's always
>possible to compile it into machine code.  It's just a question of what
>tools are available and how hard or easy it is to use them.  So no
>language is really "faster" than another language.  But some code is
>faster than other code :)

True.  Compilers also can make a huge difference in the quality of machine 
code they generate and the optimizations they make.

I did some research, which I didn't post because it got way way out of 
hand.  Sometimes its hard knowing what to believe on the Internet.  It does 
look like Java CAN win the performance battle in recursive algorithms.  The 
server VM also seems to be much faster than the client VM.  But in the end, 
I still think asserting that Java will be slower in most cases is 
accurate.  Not TOO slow, or terribly slower.  Just slower than native 
code.  That's not too astounding of a claim is it? :P

Anyway, enough time spent on this issue for me. :)  Its a valid game 
development choice if you want it.

brian.





---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: