The Implementation of Practical Functional Programming Languages

Nigel Perry · 2005

This thesis is about the design and implementation of practical functional languages. We begin with a discussion of functional language I/O, and survey existing I/O schemes highlighting their drawbacks. We then present a new I/O scheme, based on what we term result continuations, which overcomes these drawbacks. Result continuations solve the I/O problem by arranging for all I/O to be performed on behalf of the program by the O/S outside the functional domain, thus maintaining referential transparency and providing I/O sequence control. We later extend our I/O system to provide an inter-language interface between functional and imperative programs. We describe a new implementation method for functional languages, based upon a conventional imperative model modified to support and optimise the execution of functional languages. This provides comparable performance to imperative languages, and can be extended to coarse-grained implementations for current MIMD machines. The ability to overload identifiers with multiple definitions is a convenient programming feature, allowing for example the same symbol to be used for integer and matrix multiplication. Our inter-language calling mechanism together with certain useful abstractions, such as abstract data types, require existential quantification of type variables in type definitions. We show how these two can be supported in a language with polymorphism and type inference, and detail both a type system and type-checking algorithm for handling the combination of all four. We demonstrate that despite the fundamental impact existential quantification has on the type system its implementation in a type-checker can share the same mechanism as polymorphism. We further demonstrate that overloading resolution can be handled without introducing an unacceptable performance penalty.

Cited by 18 works.

Authors

References