Skip to main content

Selective Tail Call Elimination

  • Conference paper
  • First Online:
Static Analysis (SAS 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2694))

Included in the following conference series:

Abstract

Tail calls are expected not to consume stack space in most functional languages. However, there is no support for tail calls in some environments. Even in such environments, proper tail calls can be implemented with a technique called a trampoline. To reduce the overhead of trampolining while preserving stack space asymptotically we propose selective tail call elimination based on an effect system. The effect system infers the number of successive tail calls generated by the execution of an expression, and trampolines are introduced only when they are necessary.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. H. Baker. Cons should not cons its arguments, part II: Cheney on the M.T.A. SIGPLAN Notices, 30(9):17–20, 1995.

    Article  Google Scholar 

  2. N. Benton, A. Kennedy, and G. Russell. Compiling Standard ML to Java bytecodes. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming (ICFP’ 98), pages 129–140, 1998.

    Google Scholar 

  3. P. Bothner. Kawa-Compiling dynamic languages to the Java VM. In Proceedings of the USENIX 1998 Technical Conference, 1998.

    Google Scholar 

  4. M. M. T. Chakravarty and G. Keller. More types for nested data parallel programming. In Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming, pages 94–105, 1999.

    Google Scholar 

  5. W. D. Clinger. Proper tail recursion and space efficiency. In Proceedings of the ACM SIGPLAN’98 Conference on Programming Language Design and Implementation, pages 174–185. ACM Press, 1998.

    Google Scholar 

  6. V. Dornic, P. Jouvelot, and D. K. Gifford. Polymorphic time systems for estimating program complexity. ACM Letters on Programming Languages and Systems (LOPLAS), 1(1):33–45, 1992.

    Article  Google Scholar 

  7. S. D. Ganz, D. P. Friedman, and M. Wand. Trampolined style. In Proceedings of the 4th ACM SIGPLAN International Conference on Functional Programming (ICFP’ 99), pages 18–22, 1999.

    Google Scholar 

  8. D. K. Gifford and J. M. Lucassen. Integrating functional and imperative programming. In Proceedings of the ACM Conference on Lisp and Functional Programming, pages 28–38, 1986.

    Google Scholar 

  9. J. Hughes, L. Pareto, and A. Sabry. Proving the correctness of reactive systems. In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 410–423, 1996.

    Google Scholar 

  10. T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison Wesley, 1999.

    Google Scholar 

  11. J. M. Lucassen and D. K. Gifford. Polymorphic effect systems. In Proceedings of the Fifteenth ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pages 47–57, 1988.

    Google Scholar 

  12. Y. Minamide. A new criterion for safe program transformations. In Proceedings of the Forth International Workshop on Higher Order Operational Techniques in Semantics (HOOTS), volume 41(3) of ENTCS, Montreal, 2000.

    Google Scholar 

  13. Y. Minamide. Selective tail call elimination. Technical Report ISE-TR-03-192, Institute of Information Sciences and Electronics, University of Tsukuba, 2003.

    Google Scholar 

  14. Y. Minamide and J. Garrigue. On the runtime complexity of type-directed unboxing. In Proceedings of the Third ACM SIGPLAN International conference on Functional Programming, pages 1–12, 1998.

    Google Scholar 

  15. B. Reistad and D. K. Gifford. Static dependent costs for estimating execution time. In Proceedings of the 1994 ACM Conference on LISP and Functional Programming, pages 65–78, 1994.

    Google Scholar 

  16. M. Schinz and M. Odersky. Tail call elimination on the Java virtual machine. In Proceedings of the First International Workshop on Multi-Language Infrastructure and Interoperability (BABEL), volume 59(1) of ENTCS, 2001.

    Google Scholar 

  17. B. Serpette and M. Serrano. Compiling Scheme to JVM bytecode: a performance study. In Proceedings of the Seventh ACM SIGPLAN International Conference on Functional Programming, pages 259–270, 2002.

    Google Scholar 

  18. D. Tarditi, A. Acharya, and P. Lee. No assembly required: Compiling standard ML to C. ACM Letters on Programming Languages and Systems (LOPLAS), 1(2):161–177, 1992.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Minamide, Y. (2003). Selective Tail Call Elimination. In: Cousot, R. (eds) Static Analysis. SAS 2003. Lecture Notes in Computer Science, vol 2694. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44898-5_9

Download citation

  • DOI: https://doi.org/10.1007/3-540-44898-5_9

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40325-8

  • Online ISBN: 978-3-540-44898-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics