3.1 Introduction to the Compiler

3.1.2 When to compile code

Compiled code is generally faster than its interpreted counterpart, but it can also be harder to modify and debug than interpreted code. Compiled code generally does less error checking and retains less information about the environment than interpreted code does. As a result, where interpreted code would signal an error, compiled code might simply behave unexpectedly. Compiled code is also less responsive to redefinitions; in particular, changes to macro definitions that occur after compilation are not reflected in the behavior of the compiled code.

In general, as you increase the amount of optimization performed by the Compiler, you increase the differences between the compiled code and its original source code and consequently decrease the amount of available debugging information. Thus, you should gradually and incrementally compile and optimize your code to retain the best balance of debugging information, safety, and code speed. You can vary the emphasis from safety to optimization by using optimization declarations.

Most Lisp programmers work in repeated cycles of editing, compiling, and debugging portions of code. You could use the following pattern while developing code:

The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker