From push/enter to eval/apply by program transformation
Push/enter and eval/apply are two calling conventions used in implementations of functional languages. In this paper, we explore the following observation: when considering functions with multiple arguments, the stack under the push/enter and eval/apply conventions behaves similarly to two particula...
Main Authors: | , |
---|---|
Format: | Conference item |
Published: |
Electronic Proceedings in Theoretical Computer Science (EPTCS)
2015
|
_version_ | 1797060199259832320 |
---|---|
author | Pirog, M Gibbons, J |
author_facet | Pirog, M Gibbons, J |
author_sort | Pirog, M |
collection | OXFORD |
description | Push/enter and eval/apply are two calling conventions used in implementations of functional languages. In this paper, we explore the following observation: when considering functions with multiple arguments, the stack under the push/enter and eval/apply conventions behaves similarly to two particular implementations of the list datatype: the regular cons-list and a form of lists with lazy concatenation respectively. Along the lines of Danvy et al.'s functional correspondence between definitional interpreters and abstract machines, we use this observation to transform an abstract machine that implements push/enter into an abstract machine that implements eval/apply. We show that our method is flexible enough to transform the push/enter Spineless Tagless G-machine (which is the semantic core of the GHC Haskell compiler) into its eval/apply variant. |
first_indexed | 2024-03-06T20:13:57Z |
format | Conference item |
id | oxford-uuid:2b857e40-2f44-441f-8d71-19e61d6d0b3f |
institution | University of Oxford |
last_indexed | 2024-03-06T20:13:57Z |
publishDate | 2015 |
publisher | Electronic Proceedings in Theoretical Computer Science (EPTCS) |
record_format | dspace |
spelling | oxford-uuid:2b857e40-2f44-441f-8d71-19e61d6d0b3f2022-03-26T12:31:27ZFrom push/enter to eval/apply by program transformationConference itemhttp://purl.org/coar/resource_type/c_5794uuid:2b857e40-2f44-441f-8d71-19e61d6d0b3fSymplectic Elements at OxfordElectronic Proceedings in Theoretical Computer Science (EPTCS)2015Pirog, MGibbons, JPush/enter and eval/apply are two calling conventions used in implementations of functional languages. In this paper, we explore the following observation: when considering functions with multiple arguments, the stack under the push/enter and eval/apply conventions behaves similarly to two particular implementations of the list datatype: the regular cons-list and a form of lists with lazy concatenation respectively. Along the lines of Danvy et al.'s functional correspondence between definitional interpreters and abstract machines, we use this observation to transform an abstract machine that implements push/enter into an abstract machine that implements eval/apply. We show that our method is flexible enough to transform the push/enter Spineless Tagless G-machine (which is the semantic core of the GHC Haskell compiler) into its eval/apply variant. |
spellingShingle | Pirog, M Gibbons, J From push/enter to eval/apply by program transformation |
title | From push/enter to eval/apply by program transformation |
title_full | From push/enter to eval/apply by program transformation |
title_fullStr | From push/enter to eval/apply by program transformation |
title_full_unstemmed | From push/enter to eval/apply by program transformation |
title_short | From push/enter to eval/apply by program transformation |
title_sort | from push enter to eval apply by program transformation |
work_keys_str_mv | AT pirogm frompushentertoevalapplybyprogramtransformation AT gibbonsj frompushentertoevalapplybyprogramtransformation |