A Syntactic Theory of Dynamic Binding

  • Authors:
  • Luc Moreau

  • Affiliations:
  • Department of Electronics and Computer Science, University of Southampton, Southampton SO17 1BJ. United Kingdom. L.Moreau@ecs.soton.ac.uk

  • Venue:
  • Higher-Order and Symbolic Computation
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic binding, which traditionally has always been associated withLisp, is still semantically obscure to many. Even though most programminglanguages favour lexical scope, not only does dynamic binding remain aninteresting and expressive programming technique in specialised circumstances,but also it is a key notion in formal semantics. This article presents asyntactic theory that enables the programmer to perform equational reasoning onprograms using dynamic binding. The theory is proved to be sound and completewith respect to derivations allowed on programs in “dynamic-environmentpassing style”. From this theory, we derive a sequential evaluation functionin a context-rewriting system. Then, we further refine the evaluation functionin two popular implementation strategies: deep binding and shallow binding withvalue cells. Afterwards, following the saying that deep binding is suitablefor parallel evaluation, we present the parallel evaluation function of afuture-based functional language extended with constructs for dynamic binding.Finally, we exhibit the power and usefulness of dynamic binding in twodifferent ways. First, we prove that dynamic binding adds expressiveness to apurely functional language. Second, we show that dynamic binding is anessential notion in semantics that can be used to define exceptions.