Page 2 of 2

Posted: Sat Oct 08, 2005 9:58 am
by MadMax
In my opinion,

COMPILER, Changes source code to object code. creating an executable file. Object code doesn't necessarily have to be machine code, could run on some virtual machine ie Java.

INTERPRETER, Changes source code to object code, doesn't create an executable, instead it translates an instruccion then executes the code, and so on until the end of the program. Early BASIC were usualy interpreters, nowadays PERL, PYTHON (also refered to as scripting languages).

Interpreted languages can often be compiled too. The importance of using one or another is not as relevant nowadays as in the past. Compiling could take a long time and had to be recompiled every time you made a change in the source. Nowadays compilers are much faster and it's not always necessary to recompile the whole source. If you used an interpreter you could change code on the fly and try it out immediately. The price to pay was much slower programs.

In the past low-medium level languages used to be compiled and high level languages interpreted.

If one wants to one could spend the rest of ones life discussing wether something is realy a compiler or an interpreter. In the end the CPU executes and instruction after an other. But it's rare to find a piece of code nowadays that will run independently of an OS and many other stuff like directX etc.

Posted: Sat Oct 08, 2005 10:13 am
by Trond
MadMax wrote:In my opinion,

COMPILER, Changes source code to object code. creating an executable file. Object code doesn't necessarily have to be machine code, could run on some virtual machine ie Java.
I'm glad that YOUR opinion only because then the PB compiler isn't a compiler because it compiles to asm instead of object code.

Posted: Sat Oct 08, 2005 12:29 pm
by MadMax
I'm glad that YOUR opinion only because then the PB compiler isn't a compiler because it compiles to asm instead of object code.
Well, in the end, you do end with an executable. As I said one could spend endless evenings discussing whether a given compiler is a "true" compiler. I personaly don't care much. I'd say that PB is a compiler, but some might argue that what it does is change from one source to another (PB-->ASM) and that the real compiler is then FAsm.

Compiler/Interpreter are just definitions, and that in the real world they consist of various parts that carry out the necessary tasks.

Posted: Sat Oct 08, 2005 3:15 pm
by Trond
MadMax wrote:but some might argue that what it does is change from one source to another (PB-->ASM).
That's what compilers do. :wink:

Posted: Sat Oct 08, 2005 3:22 pm
by thefool
fasm isnt a compiler its an assembler. It just translates the keywords directly into opcodes, or series of them.