Abstract

Path dependent types have long served as an expressive component of the Scala programming language. They allow for the modelling of both bounded polymorphism and a degree of nominal subtyping. Nominality in turn provides the ability to capture first class modules. Thus a single language feature gives rise to a rich array of expressiveness. Recent work has proven path dependent types sound in the presence of both intersection and recursive types, but unfortunately typing remains undecidable, posing problems for programmers who rely on the results of type checkers. The Wyvern programming language is an object oriented language with path dependent types, recursive types and first class modules. In this paper we define two variants of Wyvern that feature decidable typing, along with machine checked proofs of decidability. Despite the restrictions, our approaches retain the ability to encode the parameteric polymorphism of Java generics along with many idioms of the Scala module system.

Highlights

  • A type member is a named member within an object that denotes a type

  • It would be useful to start with a decidable calculus that is free of type refinements before adding intersection types and the later subsumes the former

  • We have explored and described the problems with constructing a language with path dependent types, recursive types, dependent function types, and decidable subtyping

Read more

Summary

INTRODUCTION

A type member is a named member within an object that denotes a type. We can refer to the type denoted by type member L of some object o with the notation o.L. While type safe, subtyping in DOT is undecidable [Rompf and Amin 2016] due to its ability to encode System F

BACKGROUND
Type Refinements
Parametric Polymorphism
Modules
Nominality
Dependent Object Types
WYVERN
Wyvcore
Undecidability of Subtyping in Wyvcore
Cyclic Type Definitions
Type Graphs
RESTRICTING RECURSIVE TYPES
Subtype Decidability
Expressiveness in Wyvself
REMOVING ENVIRONMENT NARROWING
Subtype Transitivity
TYPE SAFETY
Wyvself
Wyvfix
Type Safety
Decidability of Typing
Comparison with DOT
Future work
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call