Most servers and clients in Erlang are implemented as named procedures in named modules. Similarly, processes communicate via named messages. This exposes and fixes a great deal of information about an Erlang application: The names of the modules, procedures, messages between servers and clients, etc. This talk explores how to gain anonymity through the use of anonymous higher-order procedures.
To spawn a process on a node, one must either to use a module name and a function, or to pass an anonymous procedure. In order to use a function from a module, the module file must be available on the remote node.
For a server to receive many messages, the spawned function must be recursive. Recursive functions are typically implemented in Erlang via a name in a module. Running such a server requires that the client be aware of the names of the module, function, and messages.
Functional programming languages (such as LISP, Scheme, and Erlang), permit recursion to be replaced with self-application, which means functions that are applied to themselves. This is a classical technique from functional programming. In Erlang, this technique adds flexibility, anonymity and security. Specifically, we demonstrate how to
- Spawn a fully-functional server without requiring shared modules or access to the file system.
- Have client-server groups that take the message names as arguments.
- Use random and constantly-changing message names.
See you there!