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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
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)
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)
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)
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)
Boehm, H., Weiser, M.: Garbage collection in an uncooperative environment. Software-Practice and Experience 18, 807–820 (1988)
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)
Elsman, M.: Polymorphic equality–no tags required. In: Leroy, X., Ohori, A. (eds.) TIC 1998. LNCS, vol. 1473, pp. 136–155. Springer, Heidelberg (1998)
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)
Hanson, D.R., Raghavachari, M.: A machine-independent debugger. Software – Practice and Experience 26, 1277–1299 (1996)
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)
Kwon, K., Nadathur, G., Wilson, D.S.: Implementing polymorphic typing in a logic programming language. Computer Languages 20(1), 25–42 (1994)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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