Typecasting Actors: From Akka to TAkka

Jiansen He, Philip Wadler, Philip Trinder

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Scala supports actors and message passing with the Akka library. Though Scala is statically typed, messages in Akka are dynamically typed (that is, of type Any). The Akka designers argue that using static types is "impossible" because "actor behaviour is dynamic", and, indeed, it is not clear that important actor support, such as supervision or name servers, can be implemented if messages are statically typed. Here we present TAkka, a variant of Akka where messages are statically typed, and show that it is possible to implement supervisors and name servers in such a framework. We show it is possible to smoothly migrate from Akka to TAkka, porting one module at a time. We show that TAkka can support behavioural upgrades where the new message type of an actor is a supertype of the old type. We demonstrate the expressiveness of TAkka by rewriting approximately 20 Akka applications; the percentage of lines that need to be changed varies from 44% (in a 25-line program) to 0.05% (in a 27,000-line program), with a geometric mean of 8.5%. We show that the execution speed, scalability, and throughput of TAkka programs are comparable to those of Akka programs.
Original languageEnglish
Title of host publicationProceedings of the Fifth Annual Scala Workshop
Place of PublicationNew York, NY, USA
PublisherACM
Pages23-33
Number of pages11
ISBN (Print)978-1-4503-2868-5
DOIs
Publication statusPublished - 2014

Keywords

  • actor programming, fault tolerance, type checking

Fingerprint

Dive into the research topics of 'Typecasting Actors: From Akka to TAkka'. Together they form a unique fingerprint.

Cite this