FeatherTrait

Author:

Liquori Luigi1,Spiwack Arnaud2

Affiliation:

1. INRIA, France

2. ENS Cachan, France

Abstract

In the context of statically typed, class-based languages , we investigate classes that can be extended with trait composition. A trait is a collection of methods without state; it can be viewed as an incomplete stateless class . Traits can be composed in any order, but only make sense when imported by a class that provides state variables and additional methods to disambiguate conflicting names arising between the imported traits. We introduce FeatherTrait Java (FTJ), a conservative extension of the simple lightweight class-based calculus Featherweight Java (FJ) with statically typed traits . In FTJ, classes can be built using traits as basic behavioral bricks; method conflicts between imported traits must be resolved explicitly by the user either by (i) aliasing or excluding method names in traits, or by (ii) overriding explicitly the conflicting methods in the class or in the trait itself. We present an operational semantics with a lookup algorithm, and a sound type system that guarantees that evaluating a well-typed expression never yields a message-not-understood run-time error nor gets the interpreter stuck. We give examples of the increased expressive power of the trait-based inheritance model. The resulting calculus appears to be a good starting point for a rigorous mathematical analysis of typed class-based languages featuring trait-based inheritance.

Funder

Sixth Framework Programme

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference37 articles.

1. Abadi M. and Cardelli L. 1996. A Theory of Objects. Springer Verlag New York. Abadi M. and Cardelli L. 1996. A Theory of Objects. Springer Verlag New York.

2. Allen E. Chase D. Luchangco V. Maessen J.-W. Ryu S. Steele G. L. and Tobin-Hochstadt S. 2007. The Fortress Language Specification version 1.0. http://research.sun.com/projects/plrg/fortress.pdf. Allen E. Chase D. Luchangco V. Maessen J.-W. Ryu S. Steele G. L. and Tobin-Hochstadt S. 2007. The Fortress Language Specification version 1.0. http://research.sun.com/projects/plrg/fortress.pdf.

3. Allen E. E. Bannet J. and Cartwright R. 2003. Mixins in generic java are sound. Tech. rep. Rice University. Allen E. E. Bannet J. and Cartwright R. 2003. Mixins in generic java are sound. Tech. rep. Rice University.

4. Jam---designing a Java extension with mixins

5. A calculus of module systems

Cited by 35 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Flexible Correct-by-Construction Programming;Logical Methods in Computer Science;2023-06-07

2. Variability modules;Journal of Systems and Software;2023-01

3. Traits: Correctness-by-Construction for Free;Formal Techniques for Distributed Objects, Components, and Systems;2022

4. Featherweight Swift: a Core calculus for Swift’s type system;Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering;2020-11-15

5. Software language engineers’ worst nightmare;Proceedings of the 13th ACM SIGPLAN International Conference on Software Language Engineering;2020-11-15

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3