Next Previous Up Top Contents Index

3.3 Compilation

3.3.2 Compilation modes

The Dylan language encourages programmers to write programs that can be compiled as efficiently as programs written in static languages. By adding type declarations and sealing to your project code, the Functional Developer compiler can optimize it very successfully.

However, the best optimizations come at the costs of longer build times, and less symbolic information in the debugger. During the larger proportion of your project's development, you want projects to build quickly and to be easier to debug. When it is time to deliver your product, you will want to turn all the code optimizations on even at the expense of debugging information and compilation speed.

Like other compilation systems, Functional Developer allows you to switch between both styles of compilation. For any project, you can specify the style of compilation to perform by choosing Project > Settings in any window with a Project menu, and then choosing the Compile property page.

That page offers two mode choices:

You should do the majority of your work on a project in Interactive Development mode. When compiling a project in this mode, the compiler does not perform as many optimizations as it can, and is not as strict about error checking as it can be. The idea here is to keep compilation times as short as possible.

This mode keeps symbolic information in the compiled code that will make debugging work easier. Also, if your project was compiled in this mode you will be able to do more interactive work in the debugger's interaction pane, including redefinition. However, compiled code will not be as fast as it can be.

When your project work is nearing completion, and you want to see the compiled version running as fast as possible, switch to compiling the project in Production mode. Production mode turns on all compiler optimizations. However, build times will be slower than in Interactive Development mode, and debugging and interaction will be more limited.

When you have switched to Production mode, you can use Functional Developer's optimization coloring feature to highlight inefficiencies in your code. This feature colors source code so that you can see where optimizations did and did not occur. Adding type declarations and sealing will secure new optimizations, which you can verify by refreshing the coloring after rebuilding the project. See Chapter 8, "Dispatch Optimization Coloring in the Editor".


Getting Started with Functional Developer - 31 MAR 2000

Next Previous Up Top Contents Index