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

On Tuesday 08 March 2005 15.01, Brian Barrett wrote:
[...]
> also, i would always see java as interpreted; whats the difference
> between interpreting bytecode( effecively another architecture ) and
> interpreting BASIC style commands.

Basically, if you compile to bytecode, you've done all text parsing 
and a great deal of the error checking, so there's much less work 
involved in getting the code to actually do something.

To confuse matters, traditional BASIC dialects have used (some still 
do, I think) a "half-way" approach called tokenizing, which 
essentially means that you run the code through the lexer, but then 
leave it at that, and go on to interpret this slightly more efficient 
form of source code.

(The lexer is the stage closest to the source code, that parses 
numbers, looks up names in the symbol table and stuff.)


> its faster to interpret byte code 
> but it is still iterpreted, yes?

Well, yes; you have some native code that sits in a loop reading and 
decoding VM instructions and performing the intended operations.

Pretty much the same thing as a emulator for foreign hardware, that 
is, except VMs for scripting and programming languages are often much 
higher level (ie more in the CISC direction, and/or with extremely 
powerful datatypes and addressing modes) than your average hardware 
architecture. They need this for performance, since VM instruction 
decoding code is very ineffective on most CPUs.


> unless its compiled, which is 
> confusing.

Any BASIC worth using compiles to bytecode or similar, or even native 
code, just like Java.

Anyway, whether it's compiled directly from source to native code 
(which is actually not what your average compiler does anyway; there 
are usually one or more internal intermediate formats) or by first 
compiling to VM code (ie translating to a lower level language than 
your source code) doesn't really matter all that much. What matters 
is how well the last stages of the toolchain optimize the code - or 
how long you're willing to wait for them doing that.


> personally i'd prefer if c/c++ was compiled into a bytecode and then
> recompiled into native code when you install the program.

Then why not use Java? :-) (There are other languages than Java that 
compile to Java bytecode, BTW.)

Just make sure users have a decent JVM with a good JIT... *heh*


> the problem 
> is the lack of cross platform libraries like java, which are ( i
> think), it's greatest strength.

Yeah... There are a lot of C/C++ libraries for this and that, but most 
of them support only one or two platforms or so. :-/


//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---


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


Other related posts: