开发者

Steps carried out in case of INTERPRETER and COMPILER

What exactly the difference between interpreted and compiled language.For example I want print the numbers from 1 to 100 .How exactly the sequence of operations takes place in case of interpreter and compiler.

Further,If possible please provide 开发者_开发知识库me the steps in according to Java language and C language

Thx


A compiled language is a language which converts the source code to machine code. Also known as a native application.

An interpreted language is a language which converts the source code to some intermediate. During the execution of the program, an interpretor runs the source code. Interpreted languages tend to be, but not always are, significantly slower than compiled languages. They are useful, however, for portability.

C is compiled, turning the source code:

for (int i=1;i<=100;i++) { printf("%d",i); }

into assembly, then into machine code. The processor fetches each machine instruction and executes it. This is very fast.

Java, however, converts source code to an intermidiate byte code. At run-time, it is run on a "virtual-machine", which can be slower than a native compiled application.


This already kind of a FAQ on StackOverflow :-)

For example, see the following answers:

What is the difference between implementing a compiler and an interpreter?

How does an interpreter/compiler work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜