A study of evaluation order semantics in expressions with side effects

  • Authors:
  • Nikolaos S. Papaspyrou;Dragan Maćoš

  • Affiliations:
  • Department of Electrical and Computer Engineering, Division of Computer Science, Software Engineering Laboratory, National Technical University of Athens, Polytechnioupoli, 15780 Zografou, Athens, ...;debis Systemhaus GEI, debis Haus am Potsdamer Platz, Eichhornstrasse 3, 10875 Berlin, Germany (e-mail: dmacos@debis.com)

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 2000

Quantified Score

Hi-index 0.00

Visualization

Abstract

The presence of side effects in even a very simple language of expressions gives rise to a number of semantic questions. The issue of evaluation order becomes a crucial one and, unless a specific order is enforced, the language becomes non-deterministic. In this paper we study the denotational semantics of such a language under a variety of possible evaluation strategies, from simpler to more complex, concluding with unspecified evaluation order, unspecified order of side effects and the mechanism of sequence points that is particular to the ANSI C programming language. In doing so, we adopt a dialect of Haskell as a metalanguage, instead of mathematical notation, and use monads and monad transformers to improve modularity. In this way, only small modifications are required for each transition. The result is a better understanding of different evaluation strategies and a unified way of specifying their semantics. Furthermore, a significant step is achieved towards a complete and accurate semantics for ANSI C.