Generating an efficient compiler for a data parallel language from a denotational specification

  • Johan Ringström
  • Peter Fritzson
  • Mikael Pettersson
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 786)


There are very few examples of the generation of efficient compilers from denotational specifications. Usually such compilers generate code which is orders of magnitude slower than from hand-written ones. However, as has been demonstrated by our DML (Denotational Meta Language) compiler generation system, through appropriate single-threading analysis it is possible to obtain code of comparable quality to hand-written compilers. Another problem with denotational specifications is, because of their denotational nature, the need to introduce complicated power domains to model non-determinism and parallelism. In this work we have used a more practical two-level approach: use denotational specifications to model the meaning of the source language in terms of an abstract machine of low-level operations, including data-parallel operations. Then use operational semantics for the specification of this abstract machine.

This paper reports experience from building a prototype compiler for a small Algol-like parallel language using a version of the DML system called DML-P, which has been extended to support data-parallel operations. The final code contains calls to a portable data-parallel vector code library (VCODE CVL). The speed of generated compilers are within a factor of three from handwritten ones. Extensive benchmarks of a DML-P generated compiler are presented.


Operational Semantic Abstract Syntax Abstract Machine Denotational Semantic Abstract Syntax Tree 
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.


  1. [1]
    Andrew W. Appel. Compiling with Continuations. Cambridge University Press, 1991.Google Scholar
  2. [2]
    Guy Blelloch. Vector Models for Data-Parallel Computing. MIT press, 1990.Google Scholar
  3. [3]
    Guy Blelloch, Siddhartha Chatterjee, Fritzs Knabe, Jay Sipelstein, Marco Zagha. VCODE Reference Manual (Version 1.3) Department of Computer Science, Carnegie-Mellon University, Pittsburgh, PA 15213, Jul 1992.Google Scholar
  4. [4]
    Michael J. C Gordon. The Denotational Description of Programming Languages. Springer-Verlag, 1979.Google Scholar
  5. [5]
    Robert Harper, Robin Milner, Mads Tofte. The Definition of Standard ML, Version 4. The MIT Press, 1990.Google Scholar
  6. [6]
    W. Daniel Hillis, Guy L. Steele, Jr. Data Parallel Algorithms, Communications of the ACM, Dec 1986, Vol.29, No. 12, pp. 1170–1183.CrossRefGoogle Scholar
  7. [7]
    C. A. R. Hoare. Communicating Sequential Processes, Prentice-Hall, 1985, ISBN-0-13-0153289-8.Google Scholar
  8. [8]
    Kenneth E. Iverson A Programming Language, John Wiley & Sons, Inc., 1962.Google Scholar
  9. [9]
    Pierre Jouvelot. Designing new languages or new language manipulation systems using ML. SIGPLAN Notices, 21:40–52, Aug 1986.Google Scholar
  10. [10]
    Kathleen Knobe, J. D. Lucas, Guy L. Steele. Data Optimization: Allocation of arrays to reduce communication on SIMD machines. Journal of Parallel and Distributed Computing, 8:102–118, Feb 1990.CrossRefGoogle Scholar
  11. [11]
    Peter Lee. Realistic Compiler Generation. PhD thesis, University of Michigan, 1987. Ph.D. thesis published by MIT press 1989.Google Scholar
  12. [12]
    Peter D. Mosses. SIS — Semantic Implementation System. PhD thesis, Aarhus University, 1979. TR DAIMI MD-30.Google Scholar
  13. [13]
    Peter Mosses. Unified Algebras and Action Semantics. In Proc. Symp. of Theor. Sci. (STACS'89), LNCS-349, 1989.Google Scholar
  14. [14]
    Edwin, M. Paalvast, A. J. Gemund, Henk J. Sips. A method for parallel program generation with an application to the Booster language. In Proceedings of the 1990 ACM Fourth International Conference on Supercomputing in Amsterdam, 11–15 Jun 1990.Google Scholar
  15. [15]
    L. Paulson. A semantics-directed compiler generator. In Proceedings of the 9th ACM Conference on Principles of Programming Languages, pages 224–233, 1982.Google Scholar
  16. [16]
    Mikael Pettersson. Generating efficient code from continuation semantics. In Proceedings of the 1990 Workshop on Compiler-Compilers, LNCS-477, Schwerin, Germany, 1990. Springer-Verlag.Google Scholar
  17. [17]
    Mikael Pettersson, Peter Fritzson. DML — A Meta-Language and System for the Generation of Practical and Efficient Compilers from Denotational Specifications. In Proc. of the IEEE International Conference on Computer Languages, San Francisco, Apr 27–30, 1992.Google Scholar
  18. [18]
    Mikael Pettersson. DML — A Language and System for the Generation of Efficient Compilers from Denotational Specifications. Licentiate thesis No 319. Department of Computer and Information Science, Linköping University, May 1992.Google Scholar
  19. [19]
    H. Abelson, N. I. Adams IV, D. H. Bartley, G. Brooks, R. K. Dybvig, D. P. Friedman, R. Halstead, C. Hanson, C. T. Haynes, E. Kohlbecker, D. Oxley, K. M. Pitman, G. J. Rozas, G. L. Steele jr., G. J. Sussman, Mitchell Wand. Revised 4 Report on the Algorithmic Language Scheme. Nov 1991.Google Scholar
  20. [20]
    Martin R. Raskovsky. Denotational semantics as a specification of code generators. In Proceedings of the ACM SIGPLAN 82 Conference on Compiler Construction, pages 230–244, 1982.Google Scholar
  21. [21]
    Johan Ringström, Peter Fritzson, Johan Fagerström. Predula, A Multiparadigm Parallel Programming and Debugging Environment, In Proceedings of EUROMICRO'91 conference in Vienna, short note session, IEEE Sep 1991.Google Scholar
  22. [22]
    Johan Ringström Compiler Generation for Parallel Languages from Denotational Definitions. Licentiate thesis, spring 1993. Thesis No. 380.Google Scholar
  23. [23]
    J.R. Rose and Guy L. Steele, Jr. C*: An extended C language for data parallel programming, Technical Report PL 87-5, Thinking Machines Corporation, 1986.Google Scholar
  24. [24]
    Gary W. Sabot: Paralation Lisp — Architecture Independent Parallel Programming, MIT Press, 1988.Google Scholar
  25. [25]
    Ravi Sethi. Control flow aspects of semantics directed compiling. Technical Report CSTR-98, Bell Labs, 1981.Google Scholar
  26. [26]
    David A. Schmidt. Denotational Semantics, A Methodology For Language Development. Allyn and Bacon Inc., 1986.Google Scholar
  27. [27]
    Richard M. Stallman. Using and Porting GNU CC. 1989.Google Scholar
  28. [28]
    Joseph E. Stoy. Denotational Semantics. MIT Press, 1977.Google Scholar
  29. [29]
    Thinking Machines Corporation. Introduction to Programming in C/Paris (Version 5). Thinking Machines Corporation, Cambridge, Massachusetts, Jun 1989.Google Scholar
  30. [30]
    Mitchell Wand. A semantic prototyping system. In Proc of the ACM SIGPLAN'84 Compiler Construction Conference, pages 213–222, 1984.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Johan Ringström
  • Peter Fritzson
  • Mikael Pettersson

There are no affiliations available

Personalised recommendations