Advertisement

A Calculus for Compiling and Linking Classes

  • Kathleen Fisher
  • John Reppy
  • Jon G. Riecke
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1782)

Abstract

We describe λinkς (pronounced “links”), a low-level calculus designed to serve as the basis for an intermediate representation in compilers for class-based object-oriented languages. The primitives in λinkς can express a wide range of class-based object-oriented language features, including various forms of inheritance, method override, and method dispatch. In particular, λinkς can model the object-oriented features of Moby, OCaml, and Loom, where subclasses may be derived from unknown base classes. λinkς can also serve as the intermediate representation for more conventional class mechanisms, such as Java’s. In this paper, we formally describe λinkς, give examples of its use, and discuss how standard compiler transformations can be used to optimize programs in the λinkς representation.

Keywords

Method Suite Base Classis Operational Semantic Intermediate Representation Instance Variable 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. AC96.
    Abadi, M. and L. Cardelli. A Theory of Objects. Springer-Verlag, New York, NY, 1996.zbMATHGoogle Scholar
  2. AG98.
    Arnold, K. and J. Gosling. The Java Programming Language. Addison-Wesley, Reading, MA, 2nd edition, 1998.Google Scholar
  3. AM87.
    Appel, A.W. and D. B. MacQueen. A Standard ML compiler. In FPCA’87, vol. 274 of LNCS, NewYork, NY, September 1987. Springer-Verlag, pp. 301–324.Google Scholar
  4. App92.
    Appel, A.W. Compiling with Continuations. Cambridge University Press, Cambridge, England, 1992.Google Scholar
  5. AZ99.
    Ancona, D. and E. Zucca. A primitive calculus for module systems. In PPDP’99, LNCS. Springer-Verlag, September 1999, pp. 62–79.Google Scholar
  6. Bar84.
    Barendregt, H. P. The Lambda Calculus, vol. 103 of Studies in Logic and the Foundations of Mathematics. North-Holland, revised edition, 1984.Google Scholar
  7. BFP97.
    Bruce, K. B., A. Fiech, and L. Petersen. Subtyping is not a good “match” for object-oriented languages. In ECOOP’97, vol. 1241 of LNCS, NewYork, NY, 1997. Springer-Verlag, pp. 104–127.Google Scholar
  8. BPS99.
    Bono, V., A. Patel, and V. Shmatikov. A core calculus of classes and mixins. In ECOOP’99, vol. 1628 of LNCS, NewYork, NY, June 1999. Springer-Verlag.Google Scholar
  9. Car97.
    Cardelli, L. Program fragments, linking, and modularization. In POPL’97, January 1997, pp. 266–277.Google Scholar
  10. CC98.
    Chambers, C. and W. Chen. Efficient predicate dispatching. Technical report, Department of Computer Science, University of Washington, 1998.Google Scholar
  11. DDG+95.
    Dean, J., G. DeFouw, D. Grove, V. Litvinov, and C. Chambers. Vortex: An optimizing compiler for object-oriented languages. In OOPSLA’96, October 1995, pp. 83–100.Google Scholar
  12. DEW99.
    Drossopoulou, S., S. Eisenbach, and D. Wragg. A fragment calculus — towards a model of separate compilation, linking and binary compatibility. In LICS-14, June 1999, pp. 147–156.Google Scholar
  13. DGC95.
    Dean, J., D. Grove, and C. Chambers. Optimization of object-oriented programs using static class hierarchy analysis. In ECOOP’95, August 1995.Google Scholar
  14. DH95.
    Driesen, K. and U. Hölzle. Minimizing row displacement dispatch tables. In OOPSLA’95, October 1995, pp. 141–155.Google Scholar
  15. DS84.
    Deutsch, L. P. and A. M. Schiffman. Efficient implementation of the Smalltalk-80 system. In POPL’84, January 1984, pp. 297–302.Google Scholar
  16. FF86.
    Felleisen, M. and D. P. Friedman. Control operators, the SECD-machine, and the λ-calculus. In M. Wirsing (ed.), Formal Description of Programming Concepts-III, pp. 193–219. North-Holland, NewYork, N.Y., 1986.Google Scholar
  17. FF98.
    Flatt, M. and M. Felleisen. Units: Cool modules for HOT languages. In PLDI’98, June 1998, pp. 236–248.Google Scholar
  18. FKF98.
    Flatt, M., S. Krishnamurthi, and M. Felleisen. Classes and mixins. In POPL’98, January 1998, pp. 171–183.Google Scholar
  19. FR99a.
    Fisher, K. and J. Reppy. The design of a class mechanism for Moby. In PLDI’99, May 1999, pp. 37–49.Google Scholar
  20. FR99b.
    Fisher, K. and J. Reppy. Foundations for Moby classes. Technical Memorandum, Bell Labs, Lucent Technologies, Murray Hill, NJ, February 1999.Google Scholar
  21. FSDF93.
    Flanagan, C., A. Sabry, B. F. Duba, and M. Felleisen. The essence of compiling with continuations. In PLDI’93, June 1993, pp. 237–247.Google Scholar
  22. GDGC95.
    Grove, D., J. Dean, C. Garrett, and C. Chambers. Profile-guided receiver class prediction. In OOPSLA’95, October 1995, pp. 108–123.Google Scholar
  23. GLT89.
    Girard, J.-Y., Y. Lafont, and P. Taylor. Proofs and Types. Cambridge University Press, Cambridge, England, 1989.zbMATHGoogle Scholar
  24. GM99.
    Glew, N. and G. Morrisett. Type-safe linking and modular assembly language. In POPL’99, January 1999, pp. 250–261.Google Scholar
  25. Ler98.
    Leroy, X. The Objective Caml System (release 2.00), August 1998. Available from http://pauillac.inria.fr/caml.
  26. LST99.
    League, C., Z. Shao, and V. Trifonov. Representing Java classes in a typed intermediate language. In ICFP’99, September 1999, pp. 183–196.Google Scholar
  27. OT98.
    Oliva, D. P. and A. P. Tolmach. From ML to Ada: Strongly-typed language interoperability via source translation. JFP, 8(4), July 1998, pp. 367–412.zbMATHGoogle Scholar
  28. Ram96.
    Ramsey, N. Relocating machine instructions by currying. In PLDI’96, May 1996, pp. 226–236.Google Scholar
  29. Rém92.
    Rémy, D. Efficient representation of extensible records. In ML’92 Workshop, San Francisco, USA, June 1992. pp. 12–16.Google Scholar
  30. RS98.
    Riecke, J. G. and C. Stone. Privacy via subsumption. In FOOL5, January 1998. A longer version will appear in Information and Computation.Google Scholar
  31. RV98.
    Rémy, D. and J. Vouillon. Objective ML: An effective object-oriented extension to ML. TAPOS, 4, 1998, pp. 27–50.Google Scholar
  32. Str94.
    Stroustrup, B. The Design and Evolution of C ++. Addison-Wesley, Reading, MA, 1994.Google Scholar
  33. Str97.
    Stroustrup, B. The C ++ Programming Language. Addison-Wesley, Reading, MA, 3rd edition, 1997.Google Scholar
  34. Tar96.
    Tarditi, D. Design and implementation of code optimizations for a type-directed compiler for Standard ML. Ph.D. dissertation, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA, December 1996. Available as Technical Report CMU-CS-97-108.Google Scholar
  35. Van99.
    Vanderwaart, J. C. Typed intermediate representations for compiling object-oriented languages, May 1999. Williams College Senior Honors Thesis.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Kathleen Fisher
    • 1
  • John Reppy
    • 2
  • Jon G. Riecke
    • 2
  1. 1.AT&T Labs — ResearchFlorham ParkUSA
  2. 2.Bell LaboratoriesLucent TechnologiesMurray HillUSA

Personalised recommendations