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

Giorgio Audrito, Roberto Casadei, Ferruccio Damiani, Mirko Viroli
{"title":"Computation Against a Neighbour: Addressing Large-Scale Distribution and Adaptivity with Functional Programming and Scala","authors":"Giorgio Audrito, Roberto Casadei, Ferruccio Damiani, Mirko Viroli","doi":"10.46298/lmcs-19(1:6)2023","DOIUrl":null,"url":null,"abstract":"Recent works in contexts like the Internet of Things (IoT) and large-scale\nCyber-Physical Systems (CPS) propose the idea of programming distributed\nsystems by focussing on their global behaviour across space and time. In this\nview, a potentially vast and heterogeneous set of devices is considered as an\n\"aggregate\" to be programmed as a whole, while abstracting away the details of\nindividual behaviour and exchange of messages, which are expressed\ndeclaratively. One such a paradigm, known as aggregate programming, builds on\ncomputational models inspired by field-based coordination. Existing models such\nas the field calculus capture interaction with neighbours by a so-called\n\"neighbouring field\" (a map from neighbours to values). This requires ad-hoc\nmechanisms to smoothly compose with standard values, thus complicating\nprogramming and introducing clutter in aggregate programs, libraries and\ndomain-specific languages (DSLs). To address this key issue we introduce the\nnovel notion of \"computation against a neighbour\", whereby the evaluation of\ncertain subexpressions of the aggregate program are affected by recent\ncorresponding evaluations in neighbours. We capture this notion in the\nneighbours calculus (NC), a new field calculus variant which is shown to\nsmoothly support declarative specification of interaction with neighbours, and\ncorrespondingly facilitate the embedding of field computations as internal DSLs\nin common general-purpose programming languages -- as exemplified by a Scala\nimplementation, called ScaFi. This paper formalises NC, thoroughly compares it\nwith respect to the classic field calculus, and shows its expressiveness by\nmeans of a case study in edge computing, developed in ScaFi.","PeriodicalId":314387,"journal":{"name":"Log. Methods Comput. Sci.","volume":"4 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-12-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Log. Methods Comput. Sci.","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.46298/lmcs-19(1:6)2023","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

Abstract

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.
邻域计算:用函数式编程和Scala解决大规模分布和自适应问题
最近在物联网(IoT)和大规模网络物理系统(CPS)等背景下的工作提出了通过关注其跨空间和时间的全局行为来编程分布式系统的想法。在这种观点下,一个潜在的庞大且异构的设备集被认为是一个“集合”,作为一个整体进行编程,同时抽象掉个人行为和消息交换的细节,这些细节是声明式表达的。一个这样的范例,被称为聚合编程,建立在基于领域的协调启发的计算模型上。现有的模型,如场演算,通过所谓的“邻近场”(从邻居到值的映射)来捕捉与邻居的相互作用。这需要自适应机制能够顺利地与标准值组合在一起,从而使编程变得复杂,并在聚合程序、库和领域特定语言(dsl)中引入混乱。为了解决这个关键问题,我们引入了“对邻居计算”的新概念,即聚合程序的某些子表达式的求值受到邻居中最近相应的求值的影响。我们在邻域演算(NC)中捕捉到了这一概念,邻域演算是一种新的域演算变体,它平滑地支持与邻域交互的声明性规范,并相应地促进了域计算作为内部dsl嵌入到通用编程语言中——如scala实现ScaFi所示。本文形式化了NC,将其与经典场演算进行了彻底的比较,并通过ScaFi开发的边缘计算案例研究显示了其可表达性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:604180095
Book学术官方微信