Course in Erlang

Course in Erlang programming

Erlang is sometimes considered as a new language. However, the fact is that it was created in the beginning of the 90's by Ericsson, as language for large-scale and fault-tolerant telco systems. Sadly enough, one was way ahead of time and the language never took of off - until the midst of the 00's decade.

Nowadays, Erlang is among the coolest languages you can program in. The reason is simple; no other language provides the properties of both scaling up and distributing out as Erlang has. It is therfore no coincidence that large well-known Internet actors have implemented their mission critical systems in Erlang.

This basics course in Erlang provides you with all insights and knowledge you nedd to proceed on your own with Erlang programmming. Despite the language syntactically differentiats from convential languages it is easy to get started.

This is what you will learn
  • The meaning of functional programming
  • Why Erlang was designed the way it is
  • The Actors execution model
  • Its eminent support for fault-tolerant applications
Course Contents

Background and Overview

Why Erlang was created and the peculiar history of its evolution

  • The Ellemtel research project
  • Joe Armstrong
  • Erlang properties
  • The bumby road of Erlang

Sequential Programming

All of the basic language, except concurrency which is covered in the next section

    Basic Data Types

    Scalar datatypes, tuples and lists. Pattern matching. What is a variable is in Erlang.

    • Using the Erlang shell
    • Numbers
    • Atoms
    • Booleans
    • Characters
    • Tuples
    • Lists
    • List operations
    • Strings
    • Variables
    • Pattern matching

    Functions & Modules

    Function syntax, multi-entry functions. Module syntax and exported functions.

    • Function syntax
    • Functions with multiple netry points
    • Recursive functions
    • Guards and why they are helpful and important
    • Function name
    • Files and erlang modules
    • Compilation
    • Execution of module

    BIFs & LIBs

    Built in functions overview and discussion of some of the more important modules in the standard library.

    • Erlang documentation
    • Understanding built-in functions
    • BIFs for tuples and lists
    • Type tests
    • Type conversions
    • Formatted printouts


    Walk-through of several common Erlang idioms for various iterative processing and comparison with equivalent code in Java.

    • What is recursion and why is it so important in Erlang
    • Integer iterations
    • List iterations
    • List reconstruction
    • List construction
    • List deconstruction
    • Understanding tail-recursive functions and why they are so important to master from a performance point of view
    • Writing tail-recursive function with accumulating parameters

    Advanced Expressions

    Lambda expressions and list comprehensions.

    • Conditional expressions; case and if
    • Bit lists
    • Lambda expressions (aka closures)
    • BIFs using lambdas
    • List comprehension
    • Comprehension filters and mappers
    • Patterns and comprehensions


    Pre-processor generated tuples

    • What is a record
    • Instantiation of records
    • Using getters and setters

    Concurrent Programming

    Erlang is based on current programming, In this section we cover all you need to know to start writing real Erlang programs.

      What is a thread?

      Quick conceptual overview of concurrency and why it’s important

      • Single vs. multi-threaded execution
      • Current terminology and how it clashes with the Erlang ditto
      • The concurrency model of Erlang

      Processes & Messages

      How to create and handle Erlang threads (aka processes). Sending and receiving asynchronous messages

      • Creating an Erlang thread (aka process)
      • Related BIFs
      • Looping threads
      • Non-looping threads
      • Sending messages
      • Receiving messages
      • Modelling message types
      • Receive guards


      Implementation of bi-directional synchronous message passing

      • What is rendezvous and its extended form
      • Static thread names and why its important
      • Registering a static name
      • Handling timeouts

      Linked Processes

      Language support for designing fault-tolerant systems. Links and EXIT signals.

      • The fail-fast and recover paradigm in Erlang
      • Catching EXIT signals
      • Supervison
      • EXIT propagation
      • Exceptions
      • The elaborated try-catch clause of Erlang

      Practical Programming

      Day to day working with Erlang.

        Command-Line Execution

        How to compile and run Erlang programs from the command-line and using shell scripts

        • Code path
        • Lib path
        • Environment variables for configuration
        • Compilation from the comnad-line
        • Execution from the command-line and shell scripts
        • Handling input arguments

        The Pre-Processor

        Overview of the Erlang pre-processor and brief comparison to its C/C++ counter-part

        • What is the pre-processor
        • Macro constants
        • Macro functions
        • Conditionals
        • Include files

        Using Files

        Opening files for reading and writing

        • Opening files
        • Reading from files
        • Diffent reading idioms
        • Writing to files
        • Formatted I/O
        • File operations
        • File name operations
        • Directory operations
        • Running external (forked) commands

        Using Ports

        How to fork and communicate with external programs, not written i Erlang

        • Understanding ports
        • Opening a port
        • Sending data to a port
        • Receiving data from a port
        • Obtaining port meta-data


        Different ways to bring down the Erlang VM and how to avoid it

        • Unbounded recursion
        • Zombie threads
        • Unreceived messsages
        • Lack of flow-control
        • Understanding the problem os shared mutual state and how you accidentally might introduce it in Erlang

        OTP Programming

        Brief covarage of OTP

          OTP Concepts

          Overview of the concepts and objectives

            Generic Server

            Library support for writing robust Erlang threads


              How to design fault tolerant applications using concurrent components managed by supervisors

                Duration3 Days
                Prerequisites Practical knowledge in a regular programming langauge, such as Java or C++
                • Erlang
                • Text editor or JetBrains IDEA with the Erlang plugin
                • Windows or Ubuntu Linux
                Course Dates
                2020-03-09Stockholm19 000 kr
                2020-05-25Stockholm19 000 kr

                Same-Company Discout

                We offer a 20% discount for additional participants from the same company and at the same course date. Read more here.

                Teaching Language

                Our printed course material is always authored in English. The oral presentation in our classrooms is generally in Swedish, unless all participants agree to that we perform the course in English.

                On-Site Course

                If you order an On-Site course, we will come to you and hold the course in your office. The price is determined by our price model and is based on the number of course days, number of participants and any travel and lodging.

                Read more about out price modell and term of sales here.

                Related Courses
                Perl3Beginner Show
                BASH Shell Scripts Programming1BeginnerShow