Compile-time Safety and Runtime Performance in Programming Frameworks for Distributed Systems

Abstract: Distributed Systems, that is systems that must tolerate partial failures while exploiting parallelism, are a fundamental part of the software landscape today. Yet, their development and design still pose many challenges to developers when it comes to reliability and performance, and these challenges often have a negative impact on developer productivity. Distributed programming frameworks and languages attempt to provide solutions to common challenges, so that application developers can focus on business logic. However, the choice of programming model as provided by a such a framework or language will have significant impact both on the runtime performance of applications, as well as their reliability.In this thesis, we argue for programming models that are statically typed, both for reliability and performance reasons, and that provide powerful abstractions, giving developers the tools to implement fast algorithms without being constrained by the choice of the programming model. Furthermore, we show how the design of Domain Specific Languages (DSLs) for such distributed programming frameworks, as well as DSLs for testing these components written in them, can reduce the mental gap between theoretical algorithms and their implementation, in turn reducing the risk of introducing subtle bugs.Concretely, we designed and implemented two different versions of the Kompics Component Model. The first is called Kompics Scala and focuses on pattern matching of events, as well as programming ergonomics and similarity to theoretical algorithms. The second version is called Kola and is a language with a compiler of its own, focusing on compile-time safety. Finally, we present a third framework, called Kompact, implementing a hybrid Actor–Component model which is designed around runtime-performance and static typing, and is implemented in the Rust language. In order to compare our solutions to the state-of-the-art, we present the first cross-language, distributed, message-passing benchmarking suite. We evaluated the impact of network abstractions in these models on performance, and show that our approach offers between 2× and 5× improvements on throughput for certain applications. We also evaluated the performance tradeoffs of different message-passing models and different implementations of the same model. We show that all our implementations are competitive, and our hybrid model, in particular, has significant benefits in a wide range of scenarios, leading to improvements of up to 27× compared to the state-of-the-art of message-passing systems.