skip to main content
10.1145/507635.507665acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Extensible algebraic datatypes with defaults

Authors Info & Claims
Published:01 October 2001Publication History

ABSTRACT

A major problem for writing extensible software arises when recursively defined datatypes and operations on these types have to be extended simultaneously without modifying existing code. This paper introduces Extensible Algebraic Datatypes with defaults, which promote a simple programming pattern to solve this well-known problem. We show that it is possible to encode extensible algebraic datatypes in an object-oriented language, using a new design pattern for extensible visitors. Extensible algebraic datatypes have been successfully applied in the implementation of an extensible Java compiler. Our technique allows for the reuse of existing components in compiler extensions without the need for any adaptations.

References

  1. A. Appel, L. Cardelli, K. Crary, K. Fisher, C. Gunter, R. Harper, X. Leroy, M. Lillibridge, D. B. MacQueen, J. Mitchell, G. Morrisett, J. H. Reppy, J. G. Riecke, Z. Shao, and C. A. Stone. Principles and preliminary design for ML2000. March 1999.Google ScholarGoogle Scholar
  2. M. Bchi and W. Weck. Compound types for lava. In Proc. of OOPSLA '98. pages 362-373, October 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471-522, December 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Cavin. Synchronous Java compiler. Projet do so' instre. Ecole Polyto(Imique Federate de Lausanne, S wit zerland, February 2000.Google ScholarGoogle Scholar
  5. C. Clifton, G. T. Leavens, C. Chambers, and T. Millstein. MultiJava: Modular open classes oand svtrtinetric multiple dispatch for java. In Proceedings it! OOPSLA 2000, volume 35, pages 130 145. October 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. W. R. Cook. Object-oniented programming versus abstract data types. In Foundations of Object-Oriented Languages. REX School/Workshop, .Vooidwijkerhout. 'Pie Netherlands. 1990. volume 489, Joiges 151-178. Springer-Verlag, New York. NY, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Duggan and C. Sourelis. Mixin modules. In Pioreedings of the 1996 ACM SICPLAN International Conference on Functional Programin-ing. pages 262 273. Philadelphia. Pennsylvania. 24 26 May 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Eugster, R. Guerraoui, and C. Damm. Oil object and events. In Proceedings for OOPSLA 2001, Tampa Bay. Florida, October 2001.Google ScholarGoogle Scholar
  9. R. B. Findler. Modular abstract interpreters. Unpublished mat Ill script , Carnegie Mellon University. June 1995.Google ScholarGoogle Scholar
  10. R. B. Findler and M. Flatt. Modular object-oriented programmuig with units and inixins. In Proceedings of the ACM SIGPLAN International Confeir-oce on 1- oi,ct,onal Programming (JCFP '98). volume 3-1(1). 94-104, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Flatt. Programming Languages for Reusable Software Components. PhD thesis, Rice University. Department of Computer Science, June 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Fournet and G. Gonthier. The reflexive chemical abstract nmr'hint' and I lie join-calculus. In Proc. 23rd .4 Cii Symposium On Principlcs of Programming Languages. pages 372--385. Jan. 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Gagnon and L. J. Hendren. SableCC -an object-oriented compiler framework. In Proceedings of TOOLS 1998. August 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. E. Gamma, R. Helm, R. Johnson, and T. Vlissides. Design Pattterns: Element of Reusable Object-Oriented Software. Addison-Wesley, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J . Garrigue. Programming with polymorphic variants. In ML Works/top. Septeillber 1998.Google ScholarGoogle Scholar
  16. J. Garrigue. Code reuse through polymorphic variants. In Workshop on Foundations of Software Engineering. Sasaguri, Japan, November 2000.Google ScholarGoogle Scholar
  17. J. Gosling. The evolution of numerical computing in Java, Sun Microsystems Laboratories. http://java.sun.com/people/jag/FP. html.Google ScholarGoogle Scholar
  18. J. Gosling, B. Joy, G. Steele, and G. Bracha. The java language specification. java series, Sun Microsystems, second edition. 2000. ISBN 0-201-3100S-2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Krishnamurthi, M. Felleisen, and D. Friedman. Synthesizing object-oriented and functional design to promote re-use. In European Conference on Object-Oriented Programming, pages 91-113, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. X. Leroy, D. Doligez, J. Garrigue, D. Rmy, and J. Vouillon. The Objective Carol system release 3.00, documentation and user's manual, April 2000.Google ScholarGoogle Scholar
  21. S. Liang, P. Hudak, and M. Jones. Monad transformers and modular interpreters. In Symposium on Principles of Programming Languages, pages 333-343, January 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. P. Menp and K. Oksanen. Extensible algebraic datatypes through prototypes and subtyping. Unpublished. 2000.Google ScholarGoogle Scholar
  23. M. Odersky and M. Philippsen. EspressoGriimder distribution. littp://wwwipd.ira.uka.de/espresso, Dec. 1995.Google ScholarGoogle Scholar
  24. M. Odersky and P. Wadler. Pizza into Java: Translating theory into practice. In Proc. 24th ACM Symposium on Principles of Programing Languages, pages 146--159. January 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. J. Palsberg and C. B. Jay. The essence of the visitor pattern. Technical Report 5, University of Technology, Sydney 1997Google ScholarGoogle Scholar
  26. C. Petitpierre. A case for synchronous objects ill compound-bound architect umrcs, Unpublished. Ecole Polytechnique Fddrale de Lausanne, 2000.Google ScholarGoogle Scholar
  27. M. Philippsen and M. Zenger. JavaParty transparent remote objects ill Java. Concurrency: Practice and experience, 9(11):1225 1242. November 1998.Google ScholarGoogle Scholar
  28. J. Reppy and J. Riecke, Simple objects for Standard ML. In Proc. of the ACM SIGPLAN '96 Conference on Programming Language Design and Implementation. pages 171-180. Philadelphia, Pennsylvania, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Y. Roudier and Y. lchisugi . Mixin composition strategies for the modular implementation of aspect weaving the EPI preprocessor and it's module description language. In A spcct Oriented Programming Workshop at IcSE98.April 1998.Google ScholarGoogle Scholar
  30. P. Wadler and et- al. The expression problem. Discussion on the Java-Cenerieity mailing list, December 1998.Google ScholarGoogle Scholar
  31. N. Wirth. Complier Construction. Addison-Wesley, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. M. Zenger. JaCo distribution. http: //lampwww.epfl.ch/jaco/.University of South Australia. Adelaide. November 1998.Google ScholarGoogle Scholar
  33. M. Zenger. Erweiterbare Uhersetzer. Master's thesis. University of Karlsruhe. August 1998.Google ScholarGoogle Scholar
  34. M. Zenger and M. Odersky. Implementing extensible compilers. in Proceedings of the ECOOP 2001 Workshop on Multiparadigm Programnmnzng with Object-Oriented Languages. pages 61 80. Budapest. Hungary, June 2001.Google ScholarGoogle Scholar
  35. S. Zermatten. Compound Types in Java. Projet de semestre. cole Polvtechnique F6.d6rale de Lausanne, Switzerland, little 2000. http: //lampwww epfl.ch/jaco/cjava. htmlGoogle ScholarGoogle Scholar

Index Terms

  1. Extensible algebraic datatypes with defaults

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        ICFP '01: Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
        October 2001
        277 pages
        ISBN:1581134150
        DOI:10.1145/507635
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 36, Issue 10
          October 2001
          276 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/507669
          Issue’s Table of Contents

        Copyright © 2001 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 October 2001

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        ICFP '01 Paper Acceptance Rate23of66submissions,35%Overall Acceptance Rate333of1,064submissions,31%

        Upcoming Conference

        ICFP '24

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader