Erlang Programming Introduction and Resources

Erlang is a general-purpose programming language designed for building concurrent applications.

Originally developed for telecommunication applications, it is a highly-scalable, functional language that is ideal for telecoms, web applications, distributed computing, instant messaging, ecommerce, and other services that require constant connection and need to handle simultaneous input from a large number of sources.

Some of the features that make Erlang attractive to modern programmers include:

  • Concurrency, allowing Erlang programs to accept input from multiple sources and function in the distributed environment.

  • Fault tolerance, allowing systems to continue operating even when some elements of the program fail or are at fault, making it a highly useful language for always-on environments, such as a web community or telecommunications platform.

  • Hot code loading, allowing code to be modified and programs updated without needing to stop or reboot the system.

  • Message passing rather than shared variables, allowing processes to communicate with a higher-degree of concurrency.

  • Garbage collection, providing automatic memory management for improved speed and performance.

Erlang is not as easy to jump into as some programming languages, as it's syntax and functional design are highly unique and create a sharp learning curve for new programmers.

History

The Erlang language was first developed in 1986 by Ericsson employees Joe Armstrong, Robert Virding, and Mike Williams.

The language was designed to improve existing telephony applications, and was highly influenced by the PLEX language.

The first version of Erlang was implemented in Prolog, but this proved too slow for telephone exchanges. To solve that, the team developed the BEAM virtual machine in 1992.

BEAM compiled the Erlang code to C at a much faster rate, allowing Erlang to quickly move from a prototype language to real applications. In 1995, Erlang was implemented into the ATM exchange, AXD.

In 1998, however, Ericsson Radio Systems banned the use of Erlang within any new products as it attempted to move all products to non-proprietary languages.

The new policy prompted Joe Armstrong, amongst other Erlang programmers, to resign, and ultimately led to the team releasing Erlang to the open-source world later that year.

No longer a proprietary product, and gaining traction in the telecommunication world, Ericsson later reversed its stance on Erlang and rehired Armstrong.

Erlang is now actively used by telecommunications companies world-wide, including T-Mobile, Whatsapp, Ubiquiti, and IDT Corp. Ericsson continues to maintain the language and uses it in Ericsson's support nodes and mobile networks, including their LTE networks.

Resources

Given the incredible need for concurrent programming, with web-based and mobile technologies expanding all the time, Erlang continues to grow in popularity, and many serious developers are making the switch.

As a result, there are plenty of free, online resources available to help you get started and provide assistances along the way.

  • Erlang.org: the official site of Erlang, this page includes software downloads, documentation and user guides, links to online resources and communities, and information about recent news and upcoming Erlang events.

  • Erlang Central: this community-driven site has everything you need to get started with and keep building your Erlang knowledge. It hosts tutorials, videos, a Wiki, job board, and a community forum.

  • Mostly Erlang: A regular podcast dedicated to all-things Erlang. They discuss basic programming concepts, interview key innovators, and offer advice to new and experienced Erlang programmers.

  • Erlang Factory: this annual technical conference brings together Erlang developers from across the world to discuss new innovations and theories, and offers a series of optional 3-day intensive training courses.

Books

Erlang is quite different from most languages, and even experienced programmers may want to have a handy guide available to keep track of some of its eccentricities. Whether you've been programming for years or you're throwing yourself into designing the next big mobile app, there's an Erlang title out there for you:

  • Programming Erlang: Software for a Concurrent World by Joe Armstrong: written by one of the original authors of Erlang, this is the definitive guide to the language and its usage in concurrent environments such as cloud applications, multi-user games, and community-based web sites. The book is designed for individuals with little previous experience in functional or parallel programming, and teaches these concepts through tutorials and real-world examples.

  • Building Web Applications with Erlang by Zachary Kessin: designed for experienced web developers with basic Erlang knowledge, this book walks programmers through a series of simple web service programming projects, preparing them to build their own web applications and get them online.

  • Learn You Some Erlang for Great Good! By Fred Herbert: as the humorous title suggests, this book happily admits that Erlang's syntax is unconventional, it's data structures are unusual, and its type system is generally off-putting to many newcomers — which is exactly why you need a guide to its unusual, yet powerful, conventions. It starts out slow, with very basic techniques, and builds into more complex programming concepts as the reader becomes adjusted to the intricacies of the new language. If you don't need a physical copy, the author has also made the book available for free online.

  • Introducing Erlang: Getting Started in Functional Programming by Simon St Laurent: This book devotes a lot of time on installation and Erlang's shell, making sure new programmers (or those new to Erlang) are completely comfortable with its command line interface, and then moves on to break down the language into very basic concepts and demonstrates them through the creation of simple programs.

  • Designing for Scalability with Erlang/OTP by Cesarini and Vinoski: this book is intended for experienced Erlang programmers looking to expand their understanding and utilize the Open Telecom Platform (OTP) to design and build commercial-grade systems that are both complex and scalable.

Conclusion

While still a relatively rare programming language, the Erlang community is growing quickly, particularly as demand for mobile solutions, web applications, and seamless online collaboration increases.

Though unconventional in many ways, the built-in support for concurrency and distribution, high-scalability, and fault-tolerance make Erlang a highly-attractive language in our constantly connected world.