Expressive and modular predicate dispatch for Java

Author:

Millstein Todd1,Frost Christopher1,Ryder Jason1,Warth Alessandro1

Affiliation:

1. University of California, Los Angeles, Los Angeles, CA

Abstract

Predicate dispatch is an object-oriented (OO) language mechanism for determining the method implementation to be invoked upon a message send. With predicate dispatch, each method implementation includes a predicate guard specifying the conditions under which the method should be invoked, and logical implication of predicates determines the method overriding relation. Predicate dispatch naturally unifies and generalizes several common forms of dynamic dispatch, including traditional OO dispatch, multimethod dispatch, and functional-style pattern matching. Unfortunately, prior languages supporting predicate dispatch have had several deficiencies that limit the practical utility of this language feature. We describe JPred, a backward-compatible extension to Java supporting predicate dispatch. While prior languages with predicate dispatch have been extensions to toy or nonmainstream languages, we show how predicate dispatch can be naturally added to a traditional OO language. While prior languages with predicate dispatch have required the whole program to be available for typechecking and compilation, JPred retains Java's modular typechecking and compilation strategies. While prior languages with predicate dispatch have included special-purpose algorithms for reasoning about predicates, JPred employs general-purpose, off-the-shelf decision procedures. As a result, JPred's type system is more flexible, allowing several useful programming idioms that are spuriously rejected by those other languages. After describing the JPred language informally, we present an extension to Featherweight Java that formalizes the language and its modular type system, which we have proven sound. Finally, we discuss two case studies that illustrate the practical utility of JPred, including its use in the detection of several errors.

Funder

Division of Computing and Communication Foundations

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference64 articles.

1. Static type checking of multi-methods

2. Arnold K. Gosling J. and Holmes D. 2005. The Java Programming Language 4th ed. Prentice Hall. Arnold K. Gosling J. and Holmes D. 2005. The Java Programming Language 4th ed. Prentice Hall.

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

1. Modularity and optimization in synergy;Proceedings of the 15th International Conference on Modularity;2016-03-14

2. Trace-based debugging for advanced-dispatching programming languages;Proceedings of the 10th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems;2015-07-04

3. Reusing metadata across components, applications, and languages;Science of Computer Programming;2015-02

4. AspectBreeze: integrating trustworthiness aspects into graph grammar supported architecture description language;Proceedings of the 6th Asia-Pacific Symposium on Internetware on Internetware - INTERNETWARE 2014;2014

5. Abstraction over implementation structure with symmetrically encapsulated multimethods;Science of Computer Programming;2013-07

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

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

www.globalauthorid.com

TOP

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