skip to main content
10.1145/888251.888262acmconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
Article

Formally deriving an STG machine

Published: 27 August 2003 Publication History

Abstract

Starting from P. Sestoft semantics for lazy evaluation, we define a new semantics in which normal forms consist of variables pointing to lambdas or constructions. This is in accordance with the more recent changes in the Spineless Tagless G-machine (STG) machine, where constructions only appear in closures (lambdas only appeared in closures already in previous versions). We prove the equivalence between the new semantics and Sestoft's. Then, a sequence of STG machines are derived, formally proving the correctness of each derivation. The last machine consists of a few imperative instructions and its distance to a conventional language is minimal.The paper also discusses the differences between the final machine and the actual STG machine implemented in the Glasgow Haskell Compiler.

References

[1]
A. at URL: http://www.haskell.org/ghc/.
[2]
A. Encina and R. Pena. Proving the Correctness of the STG Machine. In Implementation of Functional Languages, IFL'01. Selected Papers. LNCS 2312, pages 88--104. Springer-Verlag, 2002.
[3]
S. P. Jones and J. Launchbury. Unboxed values as first class citizens in a non-strict functional language. Conference on Functional Programming Languages and Computer Architecture FPCA'91, LNCS 523, September 1991.
[4]
J. Launchbury. A Natural Semantics for Lazy Evaluation. In Proc. Conference on Principles of Programming Languages, POPL'93. ACM, 1993.
[5]
J. Mountjoy. The Spineless Tagless G-machine, Naturally. In Third International Conference on Functional Programming, ICFP'98, Baltimore. ACM Press, 1998.
[6]
S. L. Peyton Jones. Implementing Lazy Functional Languages on Stock Hardware: the Spineless Tagless G-machine, Version 2.5. Journal of Functional Programming, 2(2):127--202, April 1992.
[7]
S. L. Peyton Jones, C. V. Hall, K. Hammond, W. D. Partain, and P. L. Wadler. The Glasgow Haskell Compiler: A Technical Overview. In Joint Framework for Inf. Technology, Keele, pages 249--257, 1993.
[8]
S. L. Peyton Jones and J. Hughes, editors. Report on the Programming Language Haskell 98. URL http://www.haskell.org, February 1999.
[9]
S. L. Peyton Jones, S. Marlow, and A. Reid. The STG Runtime System (revised). http://www.haskell.org/ghc/docs, 1999.
[10]
P. Sestoft. Deriving a Lazy Abstract Machine. Journal of Functional Programming, 7(3):231--264, May 1997.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PPDP '03: Proceedings of the 5th ACM SIGPLAN international conference on Principles and practice of declaritive programming
August 2003
292 pages
ISBN:1581137052
DOI:10.1145/888251
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 27 August 2003

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. abstract machines
  2. compiler verification
  3. functional programming
  4. operational semantics

Qualifiers

  • Article

Conference

PPDP03
Sponsor:

Acceptance Rates

PPDP '03 Paper Acceptance Rate 24 of 48 submissions, 50%;
Overall Acceptance Rate 230 of 486 submissions, 47%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)8
  • Downloads (Last 6 weeks)2
Reflects downloads up to 30 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media