The spineless tagless G-machine, naturally

  • Authors:
  • Jon Mountjoy

  • Affiliations:
  • Department of Computer Science, University of Amsterdam, Kruislaan 403, 1098 SJ Amsterdam

  • Venue:
  • ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
  • Year:
  • 1998

Quantified Score

Hi-index 0.00

Visualization

Abstract

The application of natural semantic specifications of lazy evaluation to areas such as usage analysis, formal profiling and abstract machine construction has shown it to be a useful formalism. This paper introduces several variants and extensions of this specification.The first variant is derived from observations of the Spineless Tagless G-machine (STG), used in the Glasgow Haskell compiler. We present a modified natural semantic specification which can be formally manipulated to derive an STG-like machine.The second variant is the development of a natural semantic specification which allows functions to be applied to more than one argument at once. The STG and TIM abstract machines both allow this kind of behaviour, and we illustrate a use of this semantics by again modifying this semantics following observations of the STG machine. The resulting semantics can be used to formally derive the STG machine. This effectively proves the STG machine correct with respect to Launchbury's semantics.En route, we also show that update markers in the STG machine are necessary for termination, and show how well-known abstract machine instructions, such as the squeeze operation, appear quite naturally as optimisations of the derived abstract machine.