Interpreting

The steps to run a program via an interpreter are

  1. Edit the Program
  2. Debug or Run the Program

This is a far faster process and it helps novice programmers edit and test their code quicker than using a compiler. The disadvantage is that interpreted programs run much slower than compiled programs. As much as 5-10 times slower as every line of code has to be re-read, then re-processed.

Enter Java and C#

Both of these languages are semi-compiled. They generate an intermediate code that is optimized for interpretation. This intermediate language is independant of the underlying hardware and this makes it easier to port programs written in either to other processors, so long as an interpreter has been written for that hardware.

Java when compiled produces bytecode that is interpreted at runtime by a Java Virtual Machine (JVM). Many JVMs use a Just-In-Time compiler that converts bytecode to native machine code and then runs that code to increases the interpretation speed. In effect the Java source code is compiled in a two-stage process.

C# is compiled into Common Intermediate Language (CIL, which was previously known as Microsoft Intermediate Language MSIL. This is run by the Common Language Runtime (CLR), part of the .NET framework an environment that provides support services such as garbage collection and Just-In-Time compilation.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s