Interpreted vs. Compiled Languages April 28 2006
This past week I was asked a question regarding the strengths and weaknesses of compiled vs. interpreted programming languages. To further clarify my response I thought I would take a moment and write a post to illustrate all the points that apply to this often-asked question.
Interpreted Languages
Advantages:
- Rapid Prototyping: Since the code is not compiled, a step is eliminated from the test-run cycle. Thus it could be argued that interpreted languages are suitable for rapid prototyping of programs that are not resource intensive. One could normally respond to an ad-hoc request quite quickly with an interpreted language.
- Portability: Interpreted languages are relatively portable since all you need is an interpreter compiled for your machine’s specific architecture.
- Quick-Fix: The interpreted allows a quick debug cycle since the code can be edited in place without the compile step. Some programs can take hours to compile.
- Code sharing: Everybody can read, analyze and modify your source.
Disadvantages:
- Increased utilization of system resources: Since the code requires the interpreter to be running your code, interpreted programs tend to be more resource intensive than compiled. The interpreter itself consumes disk space, ram and CPU cycles while the tasks it is trying to perform through the program will also be consuming resources.
- Code Stealing: Everybody can read, analyze and modify your source.
- Interpreter Slavery: Anyone that wants to run your program must have the interpreter. Thus you must ship a copy of the interpreter along side any program you want to distribute.
Compiled Languages
Advantages:
- Execution Speed and Memory Allocation: Compiled programs can be optimized specifically for the architecture in question, allowing for the best utilization of memory and processor resources. Keep in mind that a badly written program in a compiled language could be in fact slower than one written in an interpreted language however this is something the architect should keep mind.
- Access to Low Level System Resources: Usually (not always) compiled languages allow the coder more freedom of movement when it comes to accessing low level system resources. This could provider advantages such as access to low level graphics libraries for fast program execution.
- Code Saftey: It is not easily possible to read and analyze the source code if you only have the executable. Thus, people can not steal your code very easily. This is not to say someone could not reverse engineer your code but this is a very intensive process.
- Stand-Alone: A compiled program does not require an interpreter or other programs to run. It is self contained. Other ancillary objects may be required for an entire system to run however once a program is compiled it can run on its own.
- Compile Time Error Checking: An advantage of a compiler is that it will perform type checking and syntax checks before the program is ever allowed to run. This reduces the number of errors that can arise after a program has been distributed.
Disadvantages:
- Complex Compilation Schemes: Compiling programs across various libraries and headers can become quite complex which in the end causes the coder to waste hours of their time on how exactly to bring their creation to life rather than coding.
- Platform Dependency: Programs written in compiled languages require separate projects that are written for a specific platform. In order to get your program to run on another platform, severe code overhaul may be required. Another drawback is that compilers on different platforms may not behave the same way.
- Fixing Executables: It is basically impossible to do a quick fix on an executable without the source code. One would have to recreate the program from scratch or through reverse engineering.
- Posted in : General
- Author : site admin

Comments»
no comments yet - be the first?