George Zakhour, Pascal Weisenburger, Guido Salvaneschi
{"title":"Type-Safe Dynamic Placement with First-Class Placed Values","authors":"George Zakhour, Pascal Weisenburger, Guido Salvaneschi","doi":"10.1145/3622873","DOIUrl":null,"url":null,"abstract":"Several distributed programming language solutions have been proposed to reason about the placement of data, computations, and peers interaction. Such solutions include, among the others, multitier programming, choreographic programming and various approaches based on behavioral types. These methods statically ensure safety properties thanks to a complete knowledge about placement of data and computation at compile time. In distributed systems, however, dynamic placement of computation and data is crucial to enable performance optimizations, e.g., driven by data locality or in presence of a number of other constraints such as security and compliance regarding data storage location. Unfortunately, in existing programming languages, dynamic placement conflicts with static reasoning about distributed programs: the flexibility required by dynamic placement hinders statically tracking the location of data and computation. In this paper we present Dyno, a programming language that enables static reasoning about dynamic placement. Dyno features a type system where values are explicitly placed, but in contrast to existing approaches, placed values are also first class, ensuring that they can be passed around and referred to from other locations. Building on top of this mechanism, we provide a novel interpretation of dynamic placement as unions of placement types. We formalize type soundness, placement correctness (as part of type soundness) and architecture conformance. In case studies and benchmarks, our evaluation shows that Dyno enables static reasoning about programs even in presence of dynamic placement, ensuring type safety and placement correctness of programs at negligible performance cost. We reimplement an Android app with ∼ 7 K LOC in Dyno, find a bug in the existing implementation, and show that the app's approach is representative of a common way to implement dynamic placement found in over 100 apps in a large open-source app store.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"18 1","pages":"0"},"PeriodicalIF":2.2000,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the ACM on Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3622873","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0
Abstract
Several distributed programming language solutions have been proposed to reason about the placement of data, computations, and peers interaction. Such solutions include, among the others, multitier programming, choreographic programming and various approaches based on behavioral types. These methods statically ensure safety properties thanks to a complete knowledge about placement of data and computation at compile time. In distributed systems, however, dynamic placement of computation and data is crucial to enable performance optimizations, e.g., driven by data locality or in presence of a number of other constraints such as security and compliance regarding data storage location. Unfortunately, in existing programming languages, dynamic placement conflicts with static reasoning about distributed programs: the flexibility required by dynamic placement hinders statically tracking the location of data and computation. In this paper we present Dyno, a programming language that enables static reasoning about dynamic placement. Dyno features a type system where values are explicitly placed, but in contrast to existing approaches, placed values are also first class, ensuring that they can be passed around and referred to from other locations. Building on top of this mechanism, we provide a novel interpretation of dynamic placement as unions of placement types. We formalize type soundness, placement correctness (as part of type soundness) and architecture conformance. In case studies and benchmarks, our evaluation shows that Dyno enables static reasoning about programs even in presence of dynamic placement, ensuring type safety and placement correctness of programs at negligible performance cost. We reimplement an Android app with ∼ 7 K LOC in Dyno, find a bug in the existing implementation, and show that the app's approach is representative of a common way to implement dynamic placement found in over 100 apps in a large open-source app store.
已经提出了几种分布式编程语言解决方案来解释数据、计算和对等体交互的位置。这些解决方案包括多层编程、编排编程和基于行为类型的各种方法。由于在编译时完全了解数据和计算的位置,这些方法静态地确保了安全属性。然而,在分布式系统中,计算和数据的动态放置对于实现性能优化至关重要,例如,由数据位置驱动或存在许多其他约束,例如关于数据存储位置的安全性和遵从性。不幸的是,在现有的编程语言中,动态放置与分布式程序的静态推理相冲突:动态放置所需的灵活性阻碍了对数据和计算位置的静态跟踪。在本文中,我们介绍了Dyno,这是一种编程语言,可以对动态放置进行静态推理。Dyno具有显式放置值的类型系统,但与现有方法不同的是,放置的值也是第一类的,确保它们可以被传递并从其他位置引用。在此机制的基础上,我们将动态放置作为放置类型的联合提供了一种新的解释。我们将类型稳健性、位置正确性(作为类型稳健性的一部分)和体系结构一致性形式化。在案例研究和基准测试中,我们的评估表明,即使存在动态放置,Dyno也支持对程序的静态推理,以微不足道的性能成本确保程序的类型安全和放置正确性。我们在Dyno中重新实现了一个具有7 K LOC的Android应用程序,发现了现有实现中的一个bug,并表明该应用程序的方法代表了在大型开源应用程序商店中超过100个应用程序中实现动态放置的常见方法。