next up previous contents
Next: 4.2 Linking Up: 4 What is Needed Previous: 4 What is Needed   Contents

4.1 Interpreted vs. Compiled Languages

In an interpreted environment, the instructions are executed immediately after parsing. Both tasks are performed by the interpreter. Interpreted languages include the MS-Dos Batch language (the OS itself is the interpreter), shell scripts in Unix/Linux systems, Java, Perl and BASICA (a very old BASIC language). Advantages of interpreted languages include relative ease of programming (since once you type your instructions into a text file, the interpreter can run it) and no linker is required. Disadvantages include poor speed performance and that you do not generate an executable (and therefore distributable) program. The interpreter must be present on a system to run the program.

Modern programming contexts like 'virtual machines' managed frameworks are essentially interpreters. These are designed so that any architecture specific information is handled by the virtual machine, allowing the same source code to run on any type of platform.

Compilers parse the instructions into machine code and store them in a separate file for later execution. Many modern compilers can compile (parse) and execute in memory, giving the 'appearance' of an interpreted language. However, the key difference is that parsing and execution occurs in two distinct steps. Examples include newer forms of BASIC (such as Visual Basic), C/C++, Delphi and many others. In a compiled environment, you may speak of several separate files: source code (the text instructions you actually enter), object code (the parsed source code) and the executable (the linked object code). There is definitely an increase in complexity in using compilers, but the key advantages are speed performance and that you can distribute stand-alone executables.

Whether using a compiled or interpreted language, you will likely need a text editor in which to enter your instructions. Many compilers come complete with integrated editors optimized for working with the specific language. Using these editors is really not much different from using general text editing tools and word processors, though they may look quite different. One key point here is that so long as you follow the proper format requirements for a given interpreter or compiler, you can use any text editor you chose to construct and edit your source code.


next up previous contents
Next: 4.2 Linking Up: 4 What is Needed Previous: 4 What is Needed   Contents
John S. Riley, DSB Scientific Consulting