Domesticating imperative constructs so that they can live in a functional world

  • T. C. Nicholas Graham
  • Gerd Kock
Session: Integration Of Programming Concepts I
Part of the Lecture Notes in Computer Science book series (LNCS, volume 528)


Many problems in program analysis and transformation are simplified in the context of pure functional languages. The desire for efficiency and notational flexibility often leads, however, production versions of functional languages to include ad-hoc imperative extensions that defeat program analysis. This paper shows how a hierarchy of restricted imperative constructs can be introduced into a functional language. These constructs preserve a local impurity property where the detrimental effects of non-functional constructs are limited to the functions in which they appear. The properties of the language are investigated in the context of a formal semantics.


Semantic Function Functional Language Local Impurity Function Declaration Procedure Declaration 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    G.L. Burn. Overview of a parallel reduction machine: Project II. In Proceedings of PARLE 89, pages 385–396, 1989.Google Scholar
  2. [2]
    R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the Association of Computing Machinery, 24(1):44–67, January 1977.Google Scholar
  3. [3]
    Luca Cardelli. Two-dimensional syntax for functional languages. In Proceedings of Integrated Interactive Computing Systems, pages 107–119, 1983.Google Scholar
  4. [4]
    James R. Cordy. Compile-time detection of aliasing in Euclid programs. Software Practice and Experience, 14(8):755–768, August 1984.Google Scholar
  5. [5]
    James R. Cordy, Charles Halpern, and Eric Promislow. TXL: A rapid prototyping system for programming language dialects. In IEEE International Conference on Computer Languages, October 1988.Google Scholar
  6. [6]
    Gordon V. Cormack and Andrew K. Wright. Type-dependent parameter inference. In Proceedings of the 1990 SIGPLAN Conference on Design and Implementation of Programming Languages, 1990.Google Scholar
  7. [7]
    John Darlington, Peter Harrison, Hessam Khoshnevisan, Lee McLoughlin, Nigel Perry, Helen Pull, Mike Reeve, Keith Sephton, Lyndon While, and Sue Wright. A functional programming environment supporting execution, partial execution and transformation. In Proceedings of PARLE 89, pages 286–305, 1989.Google Scholar
  8. [8]
    David K. Gifford and John M. Lucassen. Integrating functional and imperative programming. In Proceedings of the 1986 SIGPLAN Conference on Design and Implementation of Programming Languages, pages 28–38, 1986.Google Scholar
  9. [9]
    T.C. Nicholas Graham and Gerd Kock. Domesticating imperative constructs for a functional world. Technical report, GMD, 1991.Google Scholar
  10. [10]
    Michael A. Jenkins, Janice I. Glasgow, and Carl McCrosky. Programming styles in Nial. IEEE Software, January 1986.Google Scholar
  11. [11]
    Simon L. Peyton Jones, Chris Clack, and Jon Salkild. High-performance parallel graph reduction. In Proceedings of PARLE 89, pages 193–206, 1989.Google Scholar
  12. [12]
    B.W. Lampson, J.J. Horning, R.L. London, J.G. Mitchell, and G.L. Popek. Report on the programming language Euclid. SIGPLAN Notices, 12(2), 1977.Google Scholar
  13. [13]
    Carl McCrosky. The elimination of intermediate containers in the evaluation of first-class array expressions. In IEEE International Conference on Computing Languages, pages 135–142, 1988.Google Scholar
  14. [14]
    Robin Milner. The standard ml core language. Polymorphism, 2(2):1–28, October 1985.Google Scholar
  15. [15]
    Martin Odersky. How to make destructive updates less destructive. In ACM Principles of Programming Languages, 1990.Google Scholar
  16. [16]
    Nigel Perry. I/O and inter-language calling for functional languages. In Proceedings of the Ninth International Conference of the Chilean Computer Science Society and Fifteenth Latin American Conference on Informatics, July 1989.Google Scholar
  17. [17]
    Simon Thompson. Functional programming: Executable specifications and program transformation. Fifth International Workshop on Software Specification and Design, pages 287–290, May 1989.Google Scholar
  18. [18]
    Paul Zimmermann and Wolf Zimmermann. The automatic complexity analysis of divide-and-conquer algorithms. Technical Report 1149, INRIA, December 1989.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • T. C. Nicholas Graham
    • 1
  • Gerd Kock
    • 2
  1. 1.GMD KarlsruheKarlsruhe 1Federal Republic of Germany
  2. 2.University of KarlsruheKarlsruhe 1Federal Republic of Germany

Personalised recommendations