Abstract
Object-oriented languages with multiple dispatch and multiple inheritance provide rich expressiveness but statically and modularly checking programs in such languages to guarantee that no ambiguous calls can occur at run time has been a difficult problem. We present a core calculus for Fortress, which provides various language features-notably functional methods and components- and solves the problem. Functional methods are declared within traits and may be inherited but are invoked by ordinary function calls, and therefore compete in overloading resolution with ordinary function declarations. A novel component system governs “visibility” of types and functions, and allows fine-grained control over the import of overloaded functions. We formally define the type system of Fortress with a set of static rules to guarantee no ambiguous calls at run time, and mechanize the calculus and its type safety proof in Coq.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Allen, E., Chase, D., Hallett, J.J., Luchangco, V., Maessen, J.-W., Ryu, S., Steele Jr., G.L., Tobin-Hochstadt, S.: The Fortress Language Specification Version 1.0 (March 2008)
Allen, E., Hallett, J.J., Luchangco, V., Ryu, S., Steele, G.: Modular multiple dispatch with multiple inheritance. In: Proc. ACM Symposium on Applied Computing (2007)
Allen, E., Hilburn, J., Kilpatrick, S., Luchangco, V., Ryu, S., Chase, D., Steele Jr., G.L.: Type-checking Modular Multiple Dispatch with Parametric Polymorphism and Multiple Inheritance. In: OOPSLA (2011)
Castagna, G., Ghelli, G., Longo, G.: A calculus for overloaded functions with subtyping. In: LFP (1992)
Chambers, C.: Object-oriented multi-methods in Cecil. In: Madsen, O.L. (ed.) ECOOP 1992. LNCS, vol. 615, pp. 33–56. Springer, Heidelberg (1992)
Chambers, C., Leavens, G.T.: Bececil, a core object-oriented language with block structure and multimethods: Semantics and typing. In: Proceedings of the 4th International Workshop on Foundations of Object Oriented Languages (1997)
Clifton, C., Millstein, T., Leavens, G.T., Chambers, C.: MultiJava: Design rationale, compiler implementation, and applications. ACM TOPLAS 28(3), 517–575 (2006)
The COQ Development Team. The COQ Proof Assistant, http://coq.inria.fr/
De Fraine, B., Ernst, E., Südholt, M.: Cast-Free Featherweight Java (2008), http://soft.vub.ac.be/~bdefrain/featherj
Kim, J.: MFFMM in COQ (2012), http://plrg.kaist.ac.kr/_media/research/software/mffmm_in_coq.tar.gz
Kim, J., Ryu, S.: COQ mechanization of Featherweight Fortress with multiple dispatch and multiple inheritance. In: Proceedings of the First International Conference on Certified Programs and Proofs (2011)
Kim, J., Ryu, S.: MFFMM : Modular Featherweight Fortress with Multiple Dispatch and Multiple Inheritance (June 2013), http://plrg.kaist.ac.kr/_media/research/publications/mffmm_calculus.pdf
Millstein, T., Bleckner, C., Chambers, C.: Modular typechecking for hierarchically extensible datatypes and functions. ACM TOPLAS 26(5), 836–889 (2004)
Millstein, T., Chambers, C.: Modular statically typed multimethods. Information and Computation 175(1), 76–118 (2002)
Millstein, T.D., Reay, M., Chambers, C.: Relaxed MultiJava: balancing extensibility and modular typechecking. In: OOPSLA (2003)
Nipkow, T., Paulson, L.C., Wenzel, M.T.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)
Odersky, M., Wadler, P., Wehr, M.: A second look at overloading. In: FPCA, pp. 135–146 (1995)
Oliveira, B.C.D.S., Moors, A., Odersky, M.: Type classes as objects and implicits. In: OOPSLA (2010)
Schärli, N., Ducasse, S., Nierstrasz, O., Black, A.P.: Traits: Composable Units of Behaviour. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 248–274. Springer, Heidelberg (2003)
Strniša, R., Sewell, P., Parkinson, M.: The Java module system: Core design and semantic definition. In: OOPSLA (2007)
Stroustrup, B.: The C++ Programming Language. Addison-Wesley, Reading (1986)
Szypersky, C., Omohundro, S., Murer, S.: Engineering a programming language: The type and class system of Sather. In: Gutknecht, J. (ed.) Programming Languages and System Architectures. LNCS, vol. 782, pp. 208–227. Springer, Heidelberg (1994)
Wadler, P., Blott, S.: How to make ad-hoc polymorphism less ad hoc. In: POPL (1989)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer International Publishing Switzerland
About this paper
Cite this paper
Kim, J., Ryu, S., Luchangco, V., Steele, G.L. (2013). Fine-Grained Function Visibility for Multiple Dispatch with Multiple Inheritance. In: Shan, Cc. (eds) Programming Languages and Systems. APLAS 2013. Lecture Notes in Computer Science, vol 8301. Springer, Cham. https://doi.org/10.1007/978-3-319-03542-0_11
Download citation
DOI: https://doi.org/10.1007/978-3-319-03542-0_11
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-03541-3
Online ISBN: 978-3-319-03542-0
eBook Packages: Computer ScienceComputer Science (R0)