Compilers and Interpreters

Compilers and Interpreters There are two types of translator for converting a high-level language such as Pascal into machine code; compilers and interpreters. These relieve programmers of the tedium and complexity of low-level programming and hence make programming considerably easier and less error prone. Compiler This type of translator takes the whole source code and compiles it into object code. The object code (sometimes called machine code) can then be run. Pascal is an example of a programming language that uses compilation. Interpreter This type of translator takes the source code and translates the first line of the program, and then executes it. It then does the second line, and the third line, until it gets to the end of the code. BASIC, LISP, Prolog and APL are examples of programming languages that uses interpretation. Compilers plus Interpreters. Some programs written in languages such as JAVA are both compiled and interpreted! A program is firstly compiled into an 'intermediate code'. It is then distributed to users who use a wide range of computers such as Mac or PCs. These computers then run their own 'interpreter' to convert the compiled code into a code they can use. Languages such as JAVA are said to be platform-independent, because any program written in that language can run on any machine. These types of languages are ideal for use on the

  • Ranking:
  • Word count: 3673
  • Level: AS and A Level
  • Subject: Computer Science
Access this essay