Implementing a Language for Distributed Systems: Choices and Experiences with Type Level and Macro Programming in Scala
Journal
The Art, Science, and Engineering of Programming
ISSN
2473-7321
Type
journal article
Date Issued
2020-02
Author(s)
Abstract
Multitier programming languages reduce the complexity of developing distributed software by developing the distributed system within a single coherent code base. In multitier languages, the compiler or the runtime takes care of separating the code into the components of the distributed system. This approach enables abstraction over low level implementation details such as data representation, serialization and network protocols. The ScalaLoci programming language allows developers to declare the components of the system and their architectural relation at the type level, enabling static reasoning about distribution and remote communication and guaranteeing static type safety for data transfer across components. As the compiler automatically generates the communication boilerplate among components, data transfer among components can be modeled declaratively, by specifying the data flows in the reactive programming style. In this paper, we report on the ScalaLoci implementation and on our experience with embedding ScalaLoci's language features into Scala as a host language. We show how a combination of Scala's advanced type level programming and of Scala's macro system enable enriching the language with new abstractions for distributed systems. We describe the challenges we encountered for the implementation and report on the solutions we developed. Finally, we outline suggestions for improving the Scala macro system to better support embedding domain-specific abstractions. ACM CCS Software and its engineering → Distributed programming languages; Macro languages; Domain specific languages;
Language
English
Keywords
Distributed Programming
Multitier Programming
Type Level Programming
Macro System
Scala
Publisher
AOSA, Inc
Volume
4
Number
3
Start page
17:1
End page
17:29
Pages
29
Event Title
‹Programming›
Event Location
Porto, Portugal
File(s)![Thumbnail Image]()
Name
2020_Implementing-a-Language-for-Distributed-Systems.pdf
Size
293.49 KB
Format
Adobe PDF
Checksum (MD5)
3279d99741ce9141936ec71ac0cc6fb7