1. First-class dynamic types
- Author
-
James Noble, Michael Homer, and Timothy Jones
- Subjects
Class (computer programming) ,050208 finance ,Syntax (programming languages) ,Computer science ,Programming language ,media_common.quotation_subject ,05 social sciences ,ComputerApplications_COMPUTERSINOTHERSYSTEMS ,020207 software engineering ,02 engineering and technology ,Type (model theory) ,computer.software_genre ,First class ,Primitive data type ,Debugging ,0502 economics and business ,0202 electrical engineering, electronic engineering, information engineering ,Pattern matching ,Lisp ,computer ,media_common ,computer.programming_language - Abstract
Since LISP, dynamic languages have supported dynamically-checked type annotations. Even in dynamic languages, these annotations are typically static: tests are restricted to checking low-level features of objects and values, such as primitive types or membership of an explicit programmer-defined class. We propose much more dynamic types for dynamic languages — first-class objects that programmers can customise, that can be composed with other types and depend on computed values — and to use these first-class type-like values as types. In this way programs can define their own conceptual models of types, extending both the kinds of tests programs can make via types, and the guarantees those tests can provide. Building on a comprehensive pattern-matching system and leveraging standard language syntax lets these types be created, composed, applied, and reused straightforwardly, so programmers can use these truly dynamic first-class types to make their programs easier to read, understand, and debug.
- Published
- 2019
- Full Text
- View/download PDF