Saturday, January 29, 2011

Project 5 - Interpreters and a compilers

Project 5 - Interpreters and a compilers

Compilers and Interpreters

Programmers are very quick to determine that they like things done in a very specific way. This common programmer trait has led to many different options for Interpreters and Compilers for all of the popular languages on the market. This blob posting explains what a Compiler is, What an Interpreter is, and lists a popular Interpreter and Compiler option or two for each of the major languages.

Compilers

At its very simplest, in computer programming, a Compiler is an intermediary application that takes a file from a higher level programming language, and translates the code into machine language. A compiler also performs logical and procedural hygiene, ensuring that there are no programmatic "grammar errors". A key aspect of a compiler is that it is not a real time process. A high level language will result in a file that the compiler translates into another executable file. A file is executable when it is in a low level format that a specific micro-processor platform can correctly interpret. This is one of the things that allows one root set of software, written in a high level language, can be used with minor changes on a number of different platforms. For instance, a game can be written for Apple IOS, and then re-compiled with some minor (compared to the effort necessary to rewrite the code from scratch) effort.

Compilers present a computer with high performance executable code, as opposed to a framework where an application is being interpreted a line at a time. Having a compiler act as the spell checker; grammar checker; and logic checker also ensures fewer programming errors in an application.

Interpreters give advantage to those who can’t wait to see the results of their code being run. It translates from high level code to machine code on the fly, instead of waiting a period of time for a file outputted from a high level program to be transformed into usable code. Code written for use with an interpreter is also more platform independent, meaning that there is no need to re-write the code to support hardware feature sets that differ from the original platform.

Interpreters

Interpreters on the other hand, are all about real time translation of higher level languages into machine code. Interpreters, a line at a time, will parse code that has been written in real time. The interpreter does not maintain a record of what was processed before, nor what is coming next. Like a goldfish, even if it is processing a loop of code (do this activity a thousand times in a row), it sees each iteration of a task as if it were being run for the first time.

Resources for finding Interpreters and Compilers in some popular languages


BASIC
Interpreter
Compiler
Note: Another great resource for free BASIC interpreters and compilers is http://www.thefreecountry.com/compilers/basic.shtml

PASCAL
Interpreter
Getting a PASCAL interpreter in this day and age is going to be a challange. You’ll either need to compile one from source code - http://homepages.cwi.nl/~steven/pascal/ , or you will need to use the debugging mode on an old copy of Borland Turbo Pascal
Compiler
Now that Borland Software’s Turbo Pascal is long gone, the best bet for compiling on a modern platform is Free PASCAL - http://www.freepascal.org/

C
Interpreter
The ups debugger includes a free C++ interpreter - http://ups.sourceforge.net/main.html
Compiler
Microsoft Visual Studio 2010 Express C++ - http://www.microsoft.com/express/Downloads/#2010-Visual-CPP
Note: Another great resource for free C++ interpreters and compilers is  http://www.thefreecountry.com/compilers/cpp.shtml

C++
As you can see, the same interpreters and compilers that work for C also will work for C++.
Interpreter
The ups debugger includes a free C++ interpreter - http://ups.sourceforge.net/main.html
Compiler
Microsoft Visual Studio 2010 Express C++ - http://www.microsoft.com/express/Downloads/#2010-Visual-CPP
Note: Another great resource for free C++ interpreters and compilers is  http://www.thefreecountry.com/compilers/cpp.shtml

Other References:

No comments:

Post a Comment