The distinction between statically and dynamically typed languages involves more than just the timing of type error checks. Dynamically typed languages, like JavaScript, often boast features that are not found in their statically typed counterparts, such as dynamic inheritance and first-class classes. Like first-class functions, first-class classes can be passed as arguments, returned as results or stored in variables. Furthermore, dynamic inheritance lets classes inherit from superclasses during runtime, making it impossible to always determine the superclass implementation to be inherited at compile time. Despite their utility, these features are absent from statically typed languages like Java or Scala, primarily due to the complexities they introduce to type-checking.
The emergence of languages like TypeScript, which aims to fully support JavaScript as a subset, raises the question of how to type-check these distinct features. TypeScript has indeed enabled type-checking for first-class classes and dynamic inheritance. However, the mechanism it employs is type unsound.
In this presentation, I will delve into the ‘inexact superclass problem’, a critical issue that highlights the type unsoundness in TypeScript when dealing with dynamic inheritance and first-class classes. This issue fundamentally arises from a potential mismatch between the expected interface of the superclass and its actual implementation. Such discrepancies can bypass static checks for safe method overriding, leading to instances where methods are unsafely overridden due to overlooked checks.
In summary, the inexact superclass problem encapsulates key challenges to consider when type-checking first-class classes and dynamic inheritance.
Sun 20 OctDisplayed time zone: Pacific Time (US & Canada) change
16:00 - 17:30 | |||
16:00 30mTalk | From FP to OOP and Back, ConsistentlyOnline UNSOUND David Binder University of Tübingen File Attached | ||
16:30 30mTalk | Java Method-Local Inner Classes are Unsound UNSOUND File Attached | ||
17:00 30mTalk | The Inexact Superclass ProblemOnline UNSOUND Bruno C. d. S. Oliveira University of Hong Kong |