O'Reilly logo

The Functional Approach to Programming by K. Callaway, Michel Mauny, Guy Cousineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12

Compilation

 

 

 

In this chapter, we describe a technique to compile a functional language like CAML into machine code. This compilation technique is strongly connected to the evaluation technique developed in the preceding chapter. In particular, the idea of an environment again plays a central role here, and we keep the idea of closure to represent functional values. However, you will see that these two ideas correspond to slightly different objects in a compiler.

To keep the compiler at a sufficiently conceptual level of description, we have opted to use machine code made up of instructions specially adapted to our compilation scheme. These instructions produce operations more complicated than the “real” instructions of an assembly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required