论文标题

为分布式系统实施语言:在Scala中的选择和体验具有类型级别和宏观编程

Implementing a Language for Distributed Systems: Choices and Experiences with Type Level and Macro Programming in Scala

论文作者

Weisenburger, Pascal, Salvaneschi, Guido

论文摘要

多层编程语言通过在单个连贯的代码库中开发分布式系统来降低开发分布式系统的复杂性。编译器或运行时将分布式系统组件的代码分开,从而可以在低级实现详细信息(例如数据表示,序列化和网络协议)上抽象。我们的Scalaloci语言使开发人员可以在类型级别声明不同的组件及其建筑关系,从而允许有关分发和远程通信的静态推理,并保证跨组件的静态类型安全性。编译器将多端机程序拆分为特定于组件的代码,并自动生成通信样板。组件之间的通信可以通过使用反应性编程在组件之间声明指定数据流来建模。 在本文中,我们报告了我们的设计实施以及将语言功能嵌入Scala作为主机语言的经验。我们展示了Scala的高级类型级别编程及其宏系统的组合可以用新的抽象来丰富语言。我们评论遇到的挑战以及我们为改进的宏观系统提供的当前实施和概述建议开发的解决方案,以支持域特异性抽象的这种用例。

Multitier programming languages reduce the complexity of developing distributed systems by developing the distributed system in a single coherent code base. The compiler or the runtime separate the code for the components of the distributed system, enabling abstraction over low level implementation details such as data representation, serialization and network protocols. Our ScalaLoci language allows developers to declare the different components and their architectural relation at the type level, allowing static reasoning about about distribution and remote communication and guaranteeing static type safety across components. The compiler splits the multitier program into the component-specific code and automatically generates the communication boilerplate. Communication between components can be modeled by declaratively specifying data flows between components using reactive programming. In this paper, we report on the implementation of our design and our experience with embedding our language features into Scala as a host language. We show how a combination of Scala's advanced type level programming and its macro system can be used to enrich the language with new abstractions. We comment on the challenges we encountered and the solutions we developed for our current implementation and outline suggestions for an improved macro system to support the such use cases of embedding of domain-specific abstractions.

扫码加入交流群

加入微信交流群

微信交流群二维码

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