论文标题

针对邻居的计算:通过功能编程和Scala解决大规模分布和适应性

Computation Against a Neighbour: Addressing Large-Scale Distribution and Adaptivity with Functional Programming and Scala

论文作者

Audrito, Giorgio, Casadei, Roberto, Damiani, Ferruccio, Viroli, Mirko

论文摘要

最近在物联网(IoT)和大规模网络物理系统(CPS)等上下文中的作品提出了编程分布式系统的想法,通过重点关注它们在时空的全球行为。在这种观点中,一组潜在的庞大且异质的设备集被认为是整体编程的“汇总”,同时抽象了个人行为和消息交换的细节,这些详细信息被声明地表示。一种这样的范式,称为汇总编程,建立在受现场协调启发的计算模型的基础上。现有模型,例如字段计算,通过所谓的“邻居字段”(从邻居到值的地图)捕获与邻居的交互。这需要临时机制与标准值平滑构成,从而使编程复杂并在聚合程序,库和特定于域的语言(DSLS)中引入混乱。为了解决这个关键问题,我们介绍了“针对邻居的计算”的新颖概念,从而评估骨料程序的某些子表达受到邻居最近的相应评估的影响。我们在邻居微积分(NC)中捕获了这一概念,这是一种新的字段演算变体,该变体可平滑支持与邻居相互作用的声明性规范,并相应地促进了将现场计算作为内部DSL的嵌入为常见的通用通用编程语言中的内部DSL,如Scala实现了Scala实现,称为SCAFA,称为SCAFI。本文对NC进行了形式化的NC,并将其与经典的片段进行了比较,并通过在SCAFI中开发的Edge Computing中的案例研究表明其表现力。

Recent works in contexts like the Internet of Things (IoT) and large-scale Cyber-Physical Systems (CPS) propose the idea of programming distributed systems by focussing on their global behaviour across space and time. In this view, a potentially vast and heterogeneous set of devices is considered as an "aggregate" to be programmed as a whole, while abstracting away the details of individual behaviour and exchange of messages, which are expressed declaratively. One such a paradigm, known as aggregate programming, builds on computational models inspired by field-based coordination. Existing models such as the field calculus capture interaction with neighbours by a so-called "neighbouring field" (a map from neighbours to values). This requires ad-hoc mechanisms to smoothly compose with standard values, thus complicating programming and introducing clutter in aggregate programs, libraries and domain-specific languages (DSLs). To address this key issue we introduce the novel notion of "computation against a neighbour", whereby the evaluation of certain subexpressions of the aggregate program are affected by recent corresponding evaluations in neighbours. We capture this notion in the neighbours calculus (NC), a new field calculus variant which is shown to smoothly support declarative specification of interaction with neighbours, and correspondingly facilitate the embedding of field computations as internal DSLs in common general-purpose programming languages -- as exemplified by a Scala implementation, called ScaFi. This paper formalises NC, thoroughly compares it with respect to the classic field calculus, and shows its expressiveness by means of a case study in edge computing, developed in ScaFi.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源