Subscribe to our Erlang Factory newsletter to receive the latest updates and news

András György Békés
Functional Programming Enthusiast
Ericsson Hungary

András 'Georgy' Békés is a functional programming enthusiast since his university years. Besides FP, his interests are logic & constraint programming, parallel programming and fault-tolerant systems. He works as Erlang developer at Ericsson Hungary.

András György Békés is Giving the Following Talks
ETC: An Object-Oriented Extension to Erlang

To structure the code of an Erlang program, one can split it into modules. There are also available some basic data structures: lists, records and tuples. However, there are no fully functional classes that encapsulate data and functionality, and can be extended with inheritance. We think these features could promote code reuse in certain cases, therefore we decided to extend the language with object-oriented capabilities. A strong evidence of the usability of
this is the fact that part of the program itself was rewritten using our newly created language elements, and the new version was simpler and cleaner than the original Erlang one.

Our main goals were to preserve the single-assignment nature of Erlang and to keep method-call and value-access times constant. It was also a priority to make the extension easily installable, to reach as much developers as possible. For this, we avoided changes in the Erlang compiler itself. Instead, we created the extension as a parse transformation. In our implementation a class is a module that contain the methods, and a record type whose instances are the
object instances. Both methods and fields can be inherited.

We also examined the currently available other object-oriented extensions for Erlang, and compared them with ours. Our imple-mentation has strong advantages, but it also lacks some features. Compatibility with records and speed are the main advantages. In this paper – among describing and comparing our extension – we also show the possible ways of adding the missing features.