Jump to content

What's the difference Between complied & Interpreted Languages ??????

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Heaven1977

Heaven1977

    Newbie

  • Members
  • PipPip
  • 10 posts
What's the difference Between complied & Interpreted Languages ??????

#2
lintwurm

lintwurm

    Learning Programmer

  • Members
  • PipPipPip
  • 77 posts
Just so you know, I took your subject and google'd it...
This is what I got... Don't be lazy...
Google is your friend...

A compiled language is one where you have to compile the code before it can be executed. The compilation process, for those that don't know it, transforms the source code into object code; the later can be directly executed by the microprocessor (as it's formed by opcodes), while the former can't. So, more generically, a compiled language can be executed, after compilation, without any helper utility. Examples of these include C, C++ and assembler.

An interpreted language is one where you can execute the code without compilation, by means of an interpreter. An interpreter reads the code from the source file and executes it, without converting it to machine code (forget about JIT compilers for now). The way this is done depends on the specific interpreter you are using; but to get an idea, they often construct a parse tree - an in-memory representation of the code structure - from the source file and then evaluate it. Examples of these include Perl, Python, PHP, Basic and POSIX shell scripting.

So... where do Java and C# lay? You will get different answers from different people. But, in my opinion, they are interpreted languages. Yes, you have to compile them, but the code you get - bytecode - is not directly executable by the machine: you need an interpreter that runs it afterwards, which IMHO, makes them interpreted. If someone designs a microprocessor that runs Java natively (which is theorically possible, IIRC), this could change.

And at last, let's see what JIT compilers are. JIT stands for Just-In-Time compiler; they are used in interpreters (specially, in Java VMs) to improve runtime performance. How? They convert the original bytecode to native instructions before executing them, so that they can take full profit of the underlying architecture. Note that this process is completely transparent to the developer and to the user, and only depends on the specific interpreter you are using.

Edited by lintwurm, 14 March 2011 - 06:50 AM.


#3
eafkuor

eafkuor

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 218 posts

lintwurm said:

Just so you know, I took your subject and google'd it...
This is what I got... Don't be lazy...
Google is your friend...

Exactly! Seriously, duuude

#4
DarkLordofthePenguins

DarkLordofthePenguins

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 409 posts
In a compiled language, code is parsed at compile time and converted to a binary file that contains the machine code necessary to implement a program. In an interpreted language, code is stored in a text file and parsed at run time every time it is run. In essence, one is converted to a binary executable, the other isn't. Compiled languages have the advantage of being faster and allowing you to create standalone software, such as an operating system, that doesn't need another program to interpret it. Interpreted languages speed up coding and allow you to code at a higher level, and are also generally more portable.
Programming is a journey, not a destination.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users