Shrinking Reductions in SML.NET

  • Nick Benton
  • Andrew Kennedy
  • Sam Lindley
  • Claudio Russo
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3474)


One performance-critical phase in the SML.NET compiler involves rewriting intermediate terms to monadic normal form and performing non-duplicating β-reductions. We present an imperative algorithm for this simplification phase, working with a mutable, pointer-based term representation, which significantly outperforms our existing functional algorithm. This is the first implementation and evaluation of a linear-time rewriting algorithm proposed by Appel and Jim.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Appel, A.W., Jim, T.: Shrinking lambda expressions in linear time. Journal of Functional Programming 7(5), 515–540 (1997)zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    Benton, N., Kennedy, A.: Monads, effects and transformations. In: 3rd International Workshop on Higher Order Operational Techniques in Semantics (HOOTS), Paris. ENTCS, vol. 26. Elsevier, Amsterdam (1999)Google Scholar
  3. 3.
    Benton, N., Kennedy, A., Russo, C.: SML.NET (June 2002),
  4. 4.
    Benton, N., Kennedy, A., Russo, C.: Adventures in interoperability: The SML.NET experience. In: Proc. 6th ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP) (August 2004)Google Scholar
  5. 5.
    Benton, N., Kennedy, A., Russell, G.: Compiling Standard ML to Java bytecodes. In: Proc. ACM SIGPLAN International Conference on Functional Programming (ICFP 1998), vol. 34(1), pp. 129–140 (1999)Google Scholar
  6. 6.
    Danvy, O.: A new one-pass transformation into monadic normal form. In: Hedin, G. (ed.) CC 2003. LNCS, vol. 2622, pp. 77–89. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  7. 7.
    Ecma International. ECMA Common Language Infrastructure standard (December 2002),
  8. 8.
    Hatcliff, J., Danvy, O.: A generic account of continuation-passing styles. In: Proc. 21st Annual Symposium on Principles of Programming Languages. ACM, New York (1994)Google Scholar
  9. 9.
    Lindley, S.: Normalisation by evaluation in the compilation of typed functional programming languages. PhD thesis, The University of Edinburgh (2005)Google Scholar
  10. 10.
    Peyton Jones, S.L., Santos, A.L.M.: A transformation-based optimiser for Haskell. Science of Computer Programming (1998)Google Scholar
  11. 11.
    Sabry, A., Wadler, P.: A reflection on call-by-value. ACM Transactions on Programming Languages and Systems 19(6), 916–941 (1997)CrossRefGoogle Scholar
  12. 12.
    Standard ML of New Jersey (SML/NJ) compiler:
  13. 13.
    Weeks, S., Fluet, M., Cejtin, H., Jagannathan, S.: MLton whole-program optimizing compiler:

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Nick Benton
    • 1
  • Andrew Kennedy
    • 1
  • Sam Lindley
    • 2
  • Claudio Russo
    • 1
  1. 1.Microsoft ResearchCambridge
  2. 2.LFCSUniversity of Edinburgh 

Personalised recommendations