Tech News
← Back to articles

Swift-erlang-actor-system

read original related products more articles

I'm excited to share a new actor system we've been building for Swift's distributed actors: swift-erlang-actor-system.

This actor system enables Swift programs to join a distributed Erlang cluster.

Here's an example of a simple chat program using the actor system:

Demo Video

Erlang (and other languages that run on its VM) can connect multiple runtime systems together with distributed Erlang. Each runtime is referred to as a "node". Erlang also supports "C nodes", which allow a program other than the Erlang runtime system to communicate with Erlang nodes and other C nodes.

We've wrapped this C node functionality into an actor system that can be used with Swift's distributed actors. Here's how you can try it out:

Getting Started

Install Elixir following their instructions. For example, on macOS you can install with Homebrew:

brew install elixir

Start epmd , the "Erlang Port Mapper Daemon". This is how Erlang nodes discover each other by name, instead of IP and port:

... continue reading