Linking Types for Multi-Language Software: Have Your Cake and Eat It Too

Daniel Patterson, Amal J. Ahmed
{"title":"Linking Types for Multi-Language Software: Have Your Cake and Eat It Too","authors":"Daniel Patterson, Amal J. Ahmed","doi":"10.4230/LIPIcs.SNAPL.2017.12","DOIUrl":null,"url":null,"abstract":"Software developers compose systems from components written in many different languages. A business-logic component may be written in Java or OCaml, a resource-intensive component in C or Rust, and a high-assurance component in Coq. In this multi-language world, program execution sends values from one linguistic context to another. This boundary-crossing exposes values to contexts with unforeseen behavior---that is, behavior that could not arise in the source language of the value. For example, a Rust function may end up being applied in an ML context that violates the memory usage policy enforced by Rust's type system. This leads to the question of how developers ought to reason about code in such a multi-language world where behavior inexpressible in one language is easily realized in another. \nThis paper proposes the novel idea of linking types to address the problem of reasoning about single-language components in a multi-lingual setting. Specifically, linking types allow programmers to annotate where in a program they can link with components inexpressible in their unadulterated language. This enables developers to reason about (behavioral) equality using only their own language and the annotations, even though their code may be linked with code written in a language with more expressive power.","PeriodicalId":231548,"journal":{"name":"Summit on Advances in Programming Languages","volume":"57 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-11-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"19","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Summit on Advances in Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4230/LIPIcs.SNAPL.2017.12","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 19

Abstract

Software developers compose systems from components written in many different languages. A business-logic component may be written in Java or OCaml, a resource-intensive component in C or Rust, and a high-assurance component in Coq. In this multi-language world, program execution sends values from one linguistic context to another. This boundary-crossing exposes values to contexts with unforeseen behavior---that is, behavior that could not arise in the source language of the value. For example, a Rust function may end up being applied in an ML context that violates the memory usage policy enforced by Rust's type system. This leads to the question of how developers ought to reason about code in such a multi-language world where behavior inexpressible in one language is easily realized in another. This paper proposes the novel idea of linking types to address the problem of reasoning about single-language components in a multi-lingual setting. Specifically, linking types allow programmers to annotate where in a program they can link with components inexpressible in their unadulterated language. This enables developers to reason about (behavioral) equality using only their own language and the annotations, even though their code may be linked with code written in a language with more expressive power.
多语言软件的链接类型:鱼与熊掌兼得
软件开发人员用许多不同语言编写的组件组成系统。业务逻辑组件可以用Java或OCaml编写,资源密集型组件可以用C或Rust编写,高保证组件可以用Coq编写。在这个多语言的世界中,程序执行将值从一种语言上下文中发送到另一种语言上下文中。这种跨界将值暴露在具有不可预见行为的上下文中——也就是说,在值的源语言中不可能出现的行为。例如,一个Rust函数可能最终被应用于一个违反Rust类型系统强制的内存使用策略的ML上下文中。这就引出了一个问题:在这样一个多语言的世界里,一种语言无法表达的行为在另一种语言中很容易实现,开发人员应该如何对代码进行推理。本文提出了链接类型的新思想来解决多语言环境下单语言组件的推理问题。具体来说,链接类型允许程序员注释程序中他们可以链接的组件,这些组件在纯语言中是无法表达的。这使得开发人员能够仅使用他们自己的语言和注释来推断(行为)平等,即使他们的代码可能与用具有更强表达能力的语言编写的代码相关联。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信