A Core Calculus for Mixin-Types
نویسندگان
چکیده
The programming construct mixin was invented to implement modules that provide the mechanism of abstracting uniform extensions and modifications to superclasses. One approach to implement a mixin is to parameterize a superclass of a generic class using a type parameter; however, this approach lacks the ability to declare a mixin that is also used as a type. In this paper, we propose a programming language McJava, an extension of Java that is equipped with mixin-types, a mechanism to declare a mixin that is also used as a type. Then, we develop Core McJava, a core language for McJava, and show its type soundness theorem. This core language is based on Featherweight Java (FJ), a minimum core calculus for Java. FJ is a very small subset of Java. Focusing on a few key issues, we have developed a flexible subtyping relation among mixin compositions.
منابع مشابه
A Core Calculus for Scala Type Checking
We present a minimal core calculus that captures interesting constructs of the Scala programming language: nested classes, abstract types, mixin composition, and path dependent types. We show that the problems of type assignment and subtyping in this calculus are decidable.
متن کاملDependent Object Types Towards a foundation for Scala’s type system
We propose a new type-theoretic foundation of Scala and languages like it: the Dependent Object Types (DOT) calculus. DOT models Scala’s path-dependent types, abstract type members and its mixture of nominal and structural typing through the use of refinement types. The core formalism makes no attempt to model inheritance and mixin composition. DOT normalizes Scala’s type system by unifying the...
متن کاملA Core Calculus of Classes and Mixins
We develop an imperative calculus that provides a formal model for both single and mixin inheritance. By introducing classes and mixins as the basic object-oriented constructs in a-calculus with records and references, we obtain a system with an intuitive operational semantics. New classes are produced by applying mixins to superclasses. Objects are represented by records and produced by instan...
متن کاملA Core Calculus of Mixin-Based Incomplete Objects
We design a calculus that combines class-based features with object-based ones, with the aim of fitting into a unifying setting the “best of both worlds”. In a mixin-based approach, mixins are seen as incomplete classes from which incomplete objects can be instantiated. In turn, incomplete objects can be completed in an object-based fashion. Our hybrid calculus is shown to be useful in some rea...
متن کاملEssentials of Scala
Languages like Scala fuse object-oriented programming with concepts from module systems. Like an ML module, an object can have types as members. This poses new challenges for the type theoretic foundation of these languages. Instead of a stratified solution à la ML, we are looking for a system that does not distinguish between core language and module system. In this talk I'll present a new typ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2003