开发者

Exact difference between Compiler and Interpreter? [duplicate]

开发者 https://www.devze.com 2023-01-15 04:01 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: How does an interpreter/compiler work开发者_高级运维
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

How does an interpreter/compiler work开发者_高级运维

Hi what is the exact difference between the Compiler and interpreter ?


From Wikipedia:

  • Compiler: A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code).
  • Interpreter: An interpreted language is a programming language in which programs are 'indirectly' executed ("interpreted") by an interpreter program. This can be contrasted with a compiled language which is converted into machine code and then 'directly' executed by the host CPU.


Compiler

A compiler generates machine-dependent assembly code which can then be assembled and linked to into the appropriate machine op-codes to allow the program to execute. This process can only be run at build time.

Interpreter

An interpreter generates machine-independent code which can then be on-the-fly compiled to assembly code (e.g. Just-in-Time compilation). This process can be executed at build time and / or run time.

Hope this helps!

0

精彩评论

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