Fold-Unfold Transformations on State Monadic Interpreters

作者: Thomas Johnsson

DOI: 10.1007/978-1-4471-3573-9_9

关键词:

摘要: In this paper we advocate the use of fold-unfold transformations for mastering complexity abstract machines intended real implementations. The idea is to express machine as an interpreter in a purely functional language. initial should be ‘obviously correct’ (but might inefficient — don’t care at point). Fold-unfold are then used remove inefficiencies interpreter/abstract machine. We illustrate by deriving (the equivalent of) e-scheme G-machine from composition C and EVAL instruction. This first done on call-by-name (tree reduction) interpreter. To model sharing graph manipulation that goes reduction implementation, state monads. do same transformation monadic It much less straightforward transform interpreter, have lean heavily laws monad. return can said better implementation.

参考文章(11)
Jon Fairbairn, Stuart Wray, TIM: A simple, lazy abstract machine to execute supercombinatorics international conference on functional programming. pp. 34- 45 ,(1987) , 10.1007/3-540-18317-5_3
L Simon, Peyton Jones, The implementation of functional programming languages Prentice-Hall International. ,(1987)
Simon L. Peyton Jones, Jon Salkild, The spineless tagless G-machine Proceedings of the fourth international conference on Functional programming languages and computer architecture - FPCA '89. pp. 184- 201 ,(1989) , 10.1145/99370.99385
R. M. Burstall, John Darlington, A Transformation System for Developing Recursive Programs Journal of the ACM. ,vol. 24, pp. 44- 67 ,(1977) , 10.1145/321992.321996
Philip Wadler, The essence of functional programming symposium on principles of programming languages. pp. 1- 14 ,(1992) , 10.1145/143165.143169
Guy Argo, Improving the three instruction machine Proceedings of the fourth international conference on Functional programming languages and computer architecture - FPCA '89. pp. 100- 115 ,(1989) , 10.1145/99370.99378
Thomas Johnsson, Efficient compilation of lazy evaluation Proceedings of the 1984 SIGPLAN symposium on Compiler construction - SIGPLAN '84. ,vol. 39, pp. 58- 69 ,(1984) , 10.1145/502874.502880
Simon L. Peyton Jones, Philip Wadler, Imperative functional programming Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL '93. pp. 71- 84 ,(1993) , 10.1145/158511.158524
Simon L. Peyton Jones, Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine Journal of Functional Programming. ,vol. 2, pp. 127- 202 ,(1992) , 10.1017/S0956796800000319
Will Partain, The nofib Benchmark Suite of Haskell Programs glasgow workshop on functional programming. pp. 195- 202 ,(1992) , 10.1007/978-1-4471-3215-8_17