Hostname: page-component-8448b6f56d-dnltx Total loading time: 0 Render date: 2024-04-25T02:17:25.271Z Has data issue: false hasContentIssue false

A study of evaluation order semantics in expressions with side effects

Published online by Cambridge University Press:  01 May 2000

NIKOLAOS S. PAPASPYROU
Affiliation:
Department of Electrical and Computer Engineering, Division of Computer Science, Software Engineering Laboratory, National Technical University of Athens, Polytechnioupoli, 15780 Zografou, Athens, Greece (e-mail: nickie@softlab.ntua.gr)
DRAGAN MAĆOš
Affiliation:
debis Systemhaus GEI, debis Haus am Potsdamer Platz, Eichhornstrasse 3, 10875 Berlin, Germany (e-mail: dmacos@debis.com)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Research Article
Copyright
© 2000 Cambridge University Press
Submit a response

Discussions

No Discussions have been published for this article.