In the last two years at WhatsApp we have developed eqWAlizer - a type-checker for Erlang AS IS - in style of Flow, Pyre, Hack. It’s already used in a significant part of our codebase. In this talk we overview the key eqWAlizer's design choices we made and explain the reasons behind them. Moreover, we'll report about the challenges of using Erlang in large code bases and how static typing has allowed us to scale development through providing fast signal to developers. Finally, we'll also present the lessons learned from enabling static typing for the code underpinning the largest messaging app in the world.
This paper discusses our experiences troubleshooting and optimizing Hyper-Q, an enterprise software written in Erlang. Hyper-Q implements database virtualization that translates the SQL queries of an existing application to a new database system and converts the data returned by the database system to the data representation expected by the existing application. Using a real world example, we present effective troubleshooting techniques to identify poor-performing code and general refactorings and optimizations that can improve the performance of other Erlang systems.
Federated Learning allows multiple distributed agents to contribute to a global machine learning model. Each agent trains locally and contributes to a global model by sending gradients to a central parameter server. The approach has some limitations: 1) some events may only occur in the local environment, so a global model may not perform as well as a specialized model; 2) changes in the local environment may require an agent to use some dedicated model, that is not available in a single global model; 3) a single global model approach is unable to derive new models from dealing with complex environments.
This paper proposes a novel federated learning approach, CAEFL, that is local environment aware and composes new dedicated models for new complex environments. CAEFL is implemented in Elixir to exploit transparent distribution, pattern matching, and hot-code-swapping. Pattern matching is used to transform environment sensors data to corresponding tags and aggregate data with the same environment tags on agents. It is also used on parameter server to match client’s push/pull request for these tagged models. It enables a declarative way for environment aware federated learning approach. CAEFL outperforms state of the art federated learning by 7-10% for the MNIST dataset and 2% for the FashionMNIST dataset in specific and complex environments.
Servers are a key element of current IT infrastructures, and must often deal with large numbers of concurrent requests. Reliability is crucial as any disruption is extremely costly. Some important reliable servers are implemented in actor languages/libraries that provide process isolation and supervision. Reliability benchmarks model fault scenarios to measure the reliability characteristics of systems. The paper presents the design and implementation of a new reliability benchmark for actor-based server languages: Supervised Communicating Processes (SCP). SCP extends an existing server concurrency benchmark by supervising server actors/processes. We outline Erlang and Scala/Akka SCP implementations, and an associated fault injector. We compare the reliability characteristics of Erlang and Scala/Akka for server-style computations using SCP in the following four main experiments. (1) Progressive permanent failures, where a percentage of server processes fail permanently. (2) Recovery from different percentages (0% .. 20%) of failures occurring uniformly, randomly, or in bursts, and with a range of supervisor/supervisee ratios. (3) Comparing how the Erlang and Scala/Akka SCPs handle burst, random and uniform failure patterns. (4) Comparing how Erlang and Scala/Akka handle server actor/process faults with different fault patterns and failure rates.
In this paper we introduce InfERL, an open source, scalable, and extensible static analyzer for Erlang, based on Meta’s Infer tool. InfERL has been developed at WhatsApp and it is deployed to regularly scan WhatsApp server’s Erlang code- base, detecting reliability issues and checking user-defined properties. The paper describes the Erlang specific technical challenges we had to address and our design choices. We also report on our experience in running InfERL on Erlang code at scale, supporting the messaging app used everyday by over 2 billion people.
This paper introduces a new library for implementing executable contracts in Elixir. In addition to classical contract constructs such as preconditions and postconditions, the library permits e.g. to specify exceptional behaviour (i.e. which exceptions are thrown and under which conditions), and to associate timers with function calls to detect non-terminating or too slow computations.