Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007

    Question i'm still confused between compiler and interpreter

    what's the main part of differences there?

    they said it's about when they executed

    line by line?? dont understand at all
    ... stuck

    does anyone know and could easily explain it to me?

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    I would suggest that you read a basic article on Compiler and Interpreter and then try to post a more specific question. I could provide pages of information and personal observations, but never answer your real question.


  3. #3
    Join Date
    Apr 2003
    and then there's the decidedly blurred line generated by the ever more popular just-in-time compilers which compile interpreted code on the fly and execute it.

  4. #4
    Join Date
    Jun 2007
    Interpreters - will read your "program" - work out what you want to do - then do it. You generally put all your commands into a file (called a program) and pass it to the interpreter to run. Sometimes you can simply enter a command to be interpreted. BASIC programs are generally interpreted but you could also view SQL or UNIX shell commands as being interpreted.

    Compilers - turn your programs (MyProg.c) into a lower level commands that the computer can easily understand (MyProg.exe). Sometimes this is machine code but these days is more likely to be something similar to p-code - a sort of half way house. This also means that the program is usually much faster to run. Typical examples are C and Java programs.

    Just-In-Time Compilers- run as interpreters for the most part but when they see code that is repeated often (say a big for next loop) then they will spend the time to compile that section of code so it will run much faster. In this way you get programs you can run at once from the command line like interpreters but that also run quickly like compiled programs.

    Threaded language interpreters - Are another type of beast entirely - they compile everything in small individual chunks but then allow you to run any chunk at any time. There are very few examples of this but I seem to remember Forth did this.

    The wiki explains it as
    Any language can be implemented via an interpreter or compiler; there is no such thing as an "interpreted language" or "compiled language", only interpreted and compiled implementations of a language. Indeed, a single program may contain parts that are implemented via interpreter and a compiler, e.g., some Lisp systems. Nonetheless, certain languages are best known for having particular kinds of implementations, and because of this are often termed "compiled" or "interpreted" languages (although technically these terms are more accurately reserved for implementations).

    Many "interpreters" today include some element of compilation as well, such as a bytecode compiler, as found in Perl and Python. In such an arrangement, source code is compiled to a more efficient intermediate form, which is then interpreted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts