[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article
Free access

Efficient compilation of linear recursive functions into object level loops

Published: 01 July 1986 Publication History

Abstract

Whilst widely recognised as an excellent means for solving problems and for designing software, functional programming languages have suffered from their inefficient implementations on conventional computers. A route to improved runtime performance is to transform recursively defined functions into programs which execute more quickly and/or consume less space. We derive equivalent imperative programming language loops for a large class of linear recursive functions of which the tail-recursive functions form a very small subset. We first identify a small set of primitive function defining expressions for which we determine the corresponding loop-expressions. We then determine the loop-expressions for linear functions defined by any expressions which are formed from those primitives. In this way, a very general class of linear functions can be transformed automatically into loops in the parsing phase of a compiler, since the parser has in any case to determine the hierarchical structure of function definitions. Further transformation may involve specific properties of particular defining expressions, and adopt previous schemes. In addition, equivalent linear functions can be found for many non-linear ones which can therefore also be transformed into loops.

References

[1]
J W Backus; 'Can Programming be Liberated from the yon Neumann Style? A Functional Style and its Algebra of Programs', CACM 21,8, pp 613-641, (1978)
[2]
J W Backus; 'The Algebra of functional programs: Function level reasoning, linear equations and extended definitions', In Lecture Notes in Computer Science, Vol 107" Formalization of Programming Concepts, Springer-Verlag, New York, pp 1- 43, (1981)
[3]
R M Burstall, J Darlington;' A transformation system for developing recursive programs', JACM 24,1 (1977)
[4]
R S Bird;'The promotion and accumulationstrategiesin transformationalprogramming', ACM Transactionson Programming Languages and Systems, 6,4 (1984)
[5]
F L Bauer, H Wossner; Algorithmic Language and Pro&ram Development, Spingerverlag, Berlin, (1982)
[6]
E W Dijkstra;'Lecture Notes on Program Development',In Proceedings of International Summer School on Program .Construction, Marktoberdorf, West Germany, (1978)
[7]
J S Givler, R B Kieburtz;'Schema Recognition for Program Transforamtion', ACM Symposium on LISP and Functional Programming, pp 74-85, (1984)
[8]
P G Harrison; 'Optimisation of FP programs by Linearisation', Research report Doc 85/2, Department of Computing, Imperial College, (1985)
[9]
D E Knuth, P Bendix; Simple word problems in universal algebras. Computational Problems in Abstact Algebra, Pergamon Press, pp 263-297, (I 970)
[10]
R B Ki ebur tz, J Shul ti s; ' Transformations of FP Program Schemes', in Proceedings of ACM Conference o__nn Functional Languages and Computer Architecture, Portsmouth, New Hampshire (1981)
[11]
Z Manna, R Waldinger ;' The origin of the binary- search paradigm', SRI International, Technical Note 352, (April 1985)
[12]
J H Williams ;'On the Development o~ the Algebra of Functional Programs', ACM Transactions on Programming Languages and Systems, Vol 4, pp 733-757, (1982)

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 21, Issue 7
July 1986
275 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/13310
Issue’s Table of Contents
  • cover image ACM Conferences
    SIGPLAN '86: Proceedings of the 1986 SIGPLAN symposium on Compiler construction
    July 1986
    275 pages
    ISBN:0897911970
    DOI:10.1145/12276

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 July 1986
Published in SIGPLAN Volume 21, Issue 7

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)126
  • Downloads (Last 6 weeks)28
Reflects downloads up to 16 Jan 2025

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media