Results 1 -
6 of
6
Is Structural Subtyping Useful? An Empirical Study
"... Abstract. Structural subtyping is popular in research languages, but all mainstream object-oriented languages use nominal subtyping. Since languages with structural subtyping are not in widespread use, the empirical questions of whether and how structural subtyping is useful have thus far remained u ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
Abstract. Structural subtyping is popular in research languages, but all mainstream object-oriented languages use nominal subtyping. Since languages with structural subtyping are not in widespread use, the empirical questions of whether and how structural subtyping is useful have thus far remained unanswered. This study aims to provide answers to these questions. We identified several criteria that are indicators that nominally typed programs could benefit from structural subtyping, and performed automated and manual analyses of open-source Java programs based on these criteria. Our results suggest that these programs could indeed be improved with the addition of structural subtyping. We hope this study will provide guidance for language designers who are considering use of this subtyping discipline. 1
CZ: Multiple Inheritance Without Diamonds
"... Multiple inheritance has long been plagued with the “diamond” inheritance problem, leading to solutions that restrict expressiveness, such as mixins and traits. Instead, we address the diamond problem directly, considering two difficulties it causes: ensuring a correct semantics for object initializ ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Multiple inheritance has long been plagued with the “diamond” inheritance problem, leading to solutions that restrict expressiveness, such as mixins and traits. Instead, we address the diamond problem directly, considering two difficulties it causes: ensuring a correct semantics for object initializers, and typechecking multiple dispatch in a modular fashion—the latter problem arising even with multiple interface inheritance. We show that previous solutions to these problems are either unsatisfactory or cumbersome, and suggest a novel approach: supporting multiple inheritance but forbidding diamond inheritance. Expressiveness is retained through two features: a “requires ” construct that provides a form of subtyping without inheritance (inspired by Scala [40]), and a dynamically-dispatched “super ” call similar to that found in traits. Through examples, we illustrate that inheritance diamonds can be eliminated via a combination of “requires ” and ordinary inheritance. We provide a sound formal model for our language and demonstrate its modularity and expressiveness.
Compiling Structural Types on the JVM A Comparison of Reflective and Generative Techniques from Scala’s Perspective
"... This article describes Scala’s compilation technique of structural types for the JVM. The technique uses Java reflection and polymorphic inline caches. Performance measurements of this technique are presented and analysed. Further measurements compare Scala’s reflective technique with the “generativ ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
This article describes Scala’s compilation technique of structural types for the JVM. The technique uses Java reflection and polymorphic inline caches. Performance measurements of this technique are presented and analysed. Further measurements compare Scala’s reflective technique with the “generative ” technique used by Whiteoak to compile structural types. The article ends with a comparison of reflective and generative techniques for compiling structural types. It concludes that generative techniques may, in specific cases, exhibit higher performances than reflective approaches, but that reflective techniques are easier to implement and have fewer restrictions.
Structural and Flow-Sensitive Types for Whiley
, 2011
"... Modern statically typed languages require variables to be declared with a single static type, and that subtyping relationships between used-defined types be made explicit. This contrasts with dynamically typed languages, where variables are declared implicitly, can hold values of different types at ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
Modern statically typed languages require variables to be declared with a single static type, and that subtyping relationships between used-defined types be made explicit. This contrasts with dynamically typed languages, where variables are declared implicitly, can hold values of different types at different points and have no restrictions on flow (leading to ad-hoc and implicit subtyping). We present the flow-sensitive and structural type system used in the Whiley language. This permits variables to be declared implicitly, have multiple types within a function, and be retyped after runtime type tests. Furthermore, subtyping between user-defined types is implicit, based purely on structure. The result is a statically-typed language which, for the most part, has the look and feel of a dynamic language. The typing algorithm operates in a fashion similar to dataflow analysis. Widening must be applied to ensure termination although, surprisingly, there is no loss of precision. We formalise Whiley’s type system and operational semantics, and give proofs of termination and soundness. 1
Research Statement
"... In my research, I create programming languages, analyses and tools that provide support solving for practical software engineering problems. In particular, existing programming systems are often adequate for developing software, but can lack support for effectively evolving that software. One way th ..."
Abstract
- Add to MetaCart
In my research, I create programming languages, analyses and tools that provide support solving for practical software engineering problems. In particular, existing programming systems are often adequate for developing software, but can lack support for effectively evolving that software. One way that languages can be used to address this problem is by providing additional support for software extensibility and code reuse; this is the focus of my thesis research. I use formal techniques, such as type theory, to develop my work, but I also implement my languages/analyses and evaluate the utility of my work through empirical data from real programs. I prefer to work at a research lab or at a company doing advanced development, in part because I work best in a collaborative environment. The work done in industry is often focused and practical, which I find very appealing. Unity It is often the case that existing software must be adapted to new situations, but unfortunately, existing languages do not yet provide complete support for this task. For example, programmers may wish to change existing classes (or interfaces) to implement newly defined interfaces. In current mainstream languages, it is impossible to make such modifications without changing the original source. As the use of libraries and frameworks is essentially unavoidable, there will always be type hierarchies that cannot be changed. Programmers
An Algorithmic Framework for Recursive Structural Types
, 2011
"... Structural type systems provide an interesting alternative to the more common nominal typing scheme. Many existing languages employ structural types in some form, including Modula-3, Scala and various extensions proposed for Java. Previous work has addressed many aspects of structural types, such as ..."
Abstract
- Add to MetaCart
Structural type systems provide an interesting alternative to the more common nominal typing scheme. Many existing languages employ structural types in some form, including Modula-3, Scala and various extensions proposed for Java. Previous work has addressed many aspects of structural types, such as efficient subtyping algorithms. Unlike nominal type systems, implementing a (recursive) structural type system remains a significant challenge. This is because a large gap exists between the formalisation of a recursive structural type system, and its algorithmic realisation. In this paper, we aim to reduce this gap by providing a generic framework that succinctly captures the important algorithmic issues. The framework is not tied to any particular structural type system, and can be instantiated in a variety of ways. Finally, by way of motivation, we illustrate some common instantiations of our framework. 1

