PDA

View Full Version : what's the difference of them ???



black
08-13-2002, 05:43 AM
whe reading my book--Thinking in C++, the great guy Bruce said that some language use intepreter while some others is with compiler. what's the difference and how could I distinguish them please ??? :rolleyes:

Fordy
08-13-2002, 05:51 AM
Basically, with compiled code, the machine language code is put into a file (exe for example) and this is then loaded into memory on execution. The processor then starts reading the code and doing its magic....

With an interpreted language, the code is translated to another form (could be text instructions or an intermediate language)...then at runtime this is interpreted into the machine code that the CPU runs.....

Typical compiled stuff - C++, Pascal....

Typical interpreted stuff - PHP, VBScript....

black
08-13-2002, 07:35 PM
then what about the speed between them please ? Maybe interpreter is faster but larger in size ? :rolleyes:

moi
08-13-2002, 07:39 PM
interpreted code is much slower.

black
08-13-2002, 07:57 PM
Originally posted by moi
interpreted code is much slower.

that is: interpreter are commonly slower and it's files are smaller in size, yes ? :)

adrianxw
08-14-2002, 03:45 AM
Code that needs an interpreter is, of course, useless without the interpreter. The "code" may, but is not necessarily, smaller, but to be fair, you should add the size of the interpreter.

black
08-14-2002, 05:09 AM
Originally posted by adrianxw
Code that needs an interpreter is, of course, useless without the interpreter. The "code" may, but is not necessarily, smaller, but to be fair, you should add the size of the interpreter.

thanx :)

Compiler makes the .exe file but interpreter makes .*** ones, right ?

XSquared
08-14-2002, 09:50 AM
Originally posted by black
Compiler makes the .exe file but interpreter makes .*** ones, right ?

Not necessarily. Visual Basic is an interpreted language, and you can compile it to a *.exe file, but it has an internal reference to an interpreter: MSVBVM**.dll. But some interpreted languages, such as ASP(*.asp) or PHP(*.php, *.php3) cannot be compiled.