next up previous contents
Next: How is Perl like Up: Introduction Previous: History   Contents


Interpreter vs. Compiler

Perl belongs to a class of programs known as interpreters. This means that when your perl script runs, perl itself must read your commands and carry them out. An alternative to an interpreter would be a compiler, that is a language which can convert your script to machine-level instructions once and for all, and from that point on you can run this compiled version of your program without reinvoking the compiler which produced it. One often cited benefit of compilers is that they tend to produce programs which execute faster than interpreted programs. While this is certainly true in general, many of the perl commands translate very efficiently into calls to compiled programs which are part of the perl interpreter, so they execute surprisingly quickly.

There is currently work being done to create a compiler for perl, so that programs written in perl could be compiled once, and then run repeatedly without invoking the perl interpreter.



Phil Spector 2002-10-18