If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Chit Chat > i'm still confused between compiler and interpreter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-07, 12:10
jaya28inside jaya28inside is offline
Registered User
 
Join Date: Aug 2007
Posts: 2
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?
ThQ
Reply With Quote
  #2 (permalink)  
Old 08-04-07, 12:35
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
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.

-PatP
Reply With Quote
  #3 (permalink)  
Old 08-07-07, 02:21
jwenting jwenting is offline
Registered User
 
Join Date: Apr 2003
Posts: 40
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.
Reply With Quote
  #4 (permalink)  
Old 08-15-07, 18:54
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
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
Quote:
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.
Mike
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On