Affiliation:
1. University of California, Los Angeles, CA
2. University of Washington, Seattle, WA
Abstract
One promising approach for adding object-oriented (OO) facilities to functional languages like ML is to generalize the existing datatype and function constructs to be hierarchical and extensible, so that datatype variants simulate classes and function cases simulate methods. This approach allows existing datatypes to be easily extended with both new operations and new variants, resolving a longstanding conflict between the functional and OO styles. However, previous designs based on this approach have been forced to give up
modular
typechecking, requiring whole-program checks to ensure type safety. We describe Extensible ML (EML), an ML-like language that supports hierarchical, extensible datatypes and functions while preserving purely modular typechecking. To achieve this result,EML's type system imposes a few requirements on datatype and function extensibility, but EML is still able to express both traditional functional and OO idioms. We have formalized a core version of EML and proven the associated type system sound, and we have developed a prototype interpreter for the language.
Publisher
Association for Computing Machinery (ACM)
Cited by
12 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Persimmon: Nested Family Polymorphism with Extensible Variant Types;Proceedings of the ACM on Programming Languages;2024-04-29
2. Recursive Subtyping for All;Proceedings of the ACM on Programming Languages;2023-01-09
3. Castor: Programming with extensible generative visitors;Science of Computer Programming;2020-07
4. Pattern matching in an open world;ACM SIGPLAN Notices;2020-04-07
5. Pattern matching in an open world;Proceedings of the 17th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences;2018-11-05