Skip to main content

Run Time Type Information in Mercury

  • Conference paper

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

Abstract

The logic/functional language Mercury uses a strong, mostly static type system based on polymorphic many-sorted logic. For efficiency, the Mercury compiler uses type specific representations of terms, and implements polymorphic operations such as unifications via generic code invoked with descriptions of the actual types of the operands. These descriptions, which consist of automatically generated data and code, are the main components of the Mercury runtime type information (RTTI) system. We have used this system to implement several extensions of the Mercury system, including an escape mechanism from static type checking, generic input and output facilities, a debugger, and automatic memoization, and we are in the process of using it for an accurate, native garbage collector. We give detailed information on the implementation and uses of the Mercury RTTI system as well as measurements of the space costs of the system.

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

Buying options

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

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abadi, M., Cardelli, L., Pierce, B., Plotkin, G.: Dynamic typing in a statially typed language. ACM Transactions on Programming Languages and Systems 13(2), 237–268 (1991)

    Article  Google Scholar 

  2. Aditya, S., Caro, A.: Compiler-directed type reconstruction for polymorphic languages. In: Proceedings of the 1993 ACM Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark (June 1993)

    Google Scholar 

  3. Aditya, S., Flood, C., Hicks, J.: Garbage collection for strongly-typed languages using run-time type reconstruction. In: Proceedings of the 1994 ACM Conference on Lisp and Functional Programming, June 1994, pp. 12–23 (1994)

    Google Scholar 

  4. Beierle, C., Meyer, G., Semle, H.: Extending the warren abstract machine to polymorphic order-sorted resolution. In: Proceedings of the International Logic Programming Symposium, pp. 272–286 (1991)

    Google Scholar 

  5. Boehm, H., Weiser, M.: Garbage collection in an uncooperative environment. Software-Practice and Experience 18, 807–820 (1988)

    Article  Google Scholar 

  6. Demoen, B., de la Banda, M.G., Harvey, W., Marriott, K., Stuckey, P.: Herbrand constraint solving in HAL. Technical Report 99/18, Department of Software Engineering and Computer Science, University of Melbourne, Melbourne, Australia (1998)

    Google Scholar 

  7. Elsman, M.: Polymorphic equality–no tags required. In: Leroy, X., Ohori, A. (eds.) TIC 1998. LNCS, vol. 1473, pp. 136–155. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  8. Goldberg, B.: Tag-free garbage collection for strongly typed programming languages. In: Proceedings of the SIGPLAN 1991 Conference on Programming Languages Design and Implementation, Toronto, Ontario, June 1991, pp. 165–176 (1991)

    Google Scholar 

  9. Hanson, D.R., Raghavachari, M.: A machine-independent debugger. Software – Practice and Experience 26, 1277–1299 (1996)

    Article  Google Scholar 

  10. Henderson, F., Conway, T., Somogyi, Z., Jeffery, D.: The Mercury language reference manual. Technical Report 96/10, Department of Computer Science, University of Melbourne, Melbourne, Australia (1996)

    Google Scholar 

  11. Kwon, K., Nadathur, G., Wilson, D.S.: Implementing polymorphic typing in a logic programming language. Computer Languages 20(1), 25–42 (1994)

    Article  MATH  Google Scholar 

  12. Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of Mercury, an efficient purely declarative logic programming language. Journal of Logic Programming 26(1-3), 17–64 (1996)

    Article  Google Scholar 

  13. Tarditi, D., Morrisett, G., Cheng, P., Stone, C., Harper, R., Lee, P.: TIL: A type-directed optimizing compiler for ML. In: Proceedings of the SIGPLAN 1996 Conference on Programming Language Design and Implemantation, New York, May 21-24, pp. 181–192 (1996)

    Google Scholar 

  14. Tolmach, A.: Tag-free garbage collection using explicit type parameters. In: Proceedings of the SIGPLAN 1994 Conference on Programming Languages Design and Implementation, Orlando, Florida, June 1994, pp. 1–11 (1994)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Dowd, T., Somogyi, Z., Henderson, F., Conway, T., Jeffery, D. (1999). Run Time Type Information in Mercury. In: Nadathur, G. (eds) Principles and Practice of Declarative Programming. PPDP 1999. Lecture Notes in Computer Science, vol 1702. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10704567_14

Download citation

  • DOI: https://doi.org/10.1007/10704567_14

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66540-3

  • Online ISBN: 978-3-540-48164-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics