Kurs om
Erlang för programmerare

Kurs om hur du programmerar i språket Erlang

Att kliva in i programspråket Erlangs värld är att omfamna kraften i parallellitet och skalbarhet! Vår kurs i Erlang tar dig på en spännande resa genom detta intressanta programspråk, känt för sin förmåga att bygga robusta och distribuerade system.

Du får lära dig allt du behöver veta för att bli produktiv med att utveckla applikationer i Erlang, från den Prolog-inspirerade syntaxen med recursion som repetitions-mekanism, via trådar som kommunicerar med asynkrona meddelanden till kommunicerande system via TCP.

Kursen vänder sig till programmerare som snabbt behöver lära sig språket Erlang. Detta gör vi genom att konsekvent jämföra syntax och semantik för Erlang med andra mer konventionella programspråk som Java, JavaScript, Python och C++.

{{ name }}

Snabbfakta

Namn
Erlang för programmerare
Längd
5 dagar
Nivå
Beginner
Målgrupp
Tekniska programmerare
Förkunskaper
Praktiska kunskaper i något annat program språk
Programvara & Verktyg
  • Erlang Run-Time
  • Text editor or IDE
Relaterade Kurser

Detta får du lära dig på kursen

Här är ett sammandrag i punktform av vad du får lära dig på kursen. Eftersom kursmaterialet är författat på engelska, så återger vi sammandraget också på engelska.

  • Master recursion for loop control and understand the value of tail-recursion and accumulating parameters
  • Be fluent in list comprehension
  • Using records
  • Create multi-threaded application communicating with asynchronous messages
  • Implement message rendezvous
  • Designing robust systems with linked supervisor threads
  • Using files, ports and TCP sockets
  • Understand anti-patterns of Erlang, that means how you not write Erlang code
  • Understand the OTP part of Erlang

Kursdatum

Här ser du vilka kursdatum som är tillgängliga. Klicka på en av datumknapparna för att anmäla dig till ett kurstillfälle. På kursen pratar läraren svenska, medan vårt kursmaterial alltid är författat på engelska.

Missa inte vår samfaktureringsrabatt! Är ni fler personer från samma företag/organisation som går på samma kurs, rabatteras tillkommande personer med 25%. Ni anmäler er till kursen en och en, men uppger samma företag, så ordnar vi resten. Samtliga deltagare från samma företag ingår på samma faktura, den första till fullt pris och resterande till rabatterat pris.

Klassrum

Du sitter bekvämt i ett av våra klassrum, vilka finns centralt placerade i Stockholms innerstad.

I priset ingår tryckt kursmaterial (och som PDF), samt kaffe/te med smörgås på förmiddagen och kaffe/te med bulle på eftermiddagen.

Pris: 26 000 kr + moms

Fjärrkurs

Du sitter bekvämt framför datorn och deltar i kursen via internet. Vi använder programvaran Zoom för alla våra fjärrkurser.

I priset ingår kursmaterial som PDF.

Pris: 22 000 kr + moms

Företagsinternt

Om ni är tre eller fler personer från samma företag eller organisation, kan ni beställa en företagsanpassad kurs. Då håller vi kursen på ett datum som passar er. Antingen på plats i era lokaler eller som en fjärrkurs. Vi kan också hålla den muntliga framställningen på engelska.

Klicka på knappen nedan för att be om en offert.

Företagsanpassad Kurs

Kursinnehåll

Eftersom kursmaterialet är författat på engelska, så återger vi innehållet också på engelska.

Background

  • Why Erlang was created
  • Joe Armstrong
  • Language properties
  • Erlang - The Movie
  • The ups and downs of Erlang - It's history

Installation

  • Different ways of installing Erlang
  • Using the CLI
  • Choosing a decent IDE for Erlang development
  • Using the shell

Sequential Programming

The fundamental parts of Erlang, sans concurrent topics

Basic Data Types

  • Numbers
  • Atoms
  • Booleans
  • Characters
  • Tuples
  • Lists
  • Strings
  • Variables
  • The single-assignment property
  • Pattern matching
  • Binary data

Functions & Modules

  • Single-entry functions
  • Multi-entry functions
  • Recursive functions
  • Matching guards
  • Modules
  • Compilation
  • Execution
  • Case expressions
  • If expressions

Built-In Functions (BIFs)

  • Overview of the official Erlang documentation
  • What is a BIF?
  • BIFs for tuples
  • BIFs for lists
  • BIFs for type tests
  • BIFs for type conversions
  • Overview of the standard library
  • Formatted printouts

Recursion - Loops

There are no loop statements in Erlang, which means all repetition work must be implemented using recursion. This means it's paramount to understand this topic in Erlang. In addition, it's important tail-recursion and its impact on performance. In this chapter we will compare loop constructs in conventional languages with how these are realized in Erlang.

  • What is recursion? See recursion
  • Integer iteration
  • List iteration
  • List reconstruction
  • List construction
  • List deconstruction
  • Tail recursive functions
  • Using an accumulating parameter, instead of returning a value

Lambda Expressions

  • What a closure/lambda?
  • What is the purpose of lambdas in Erlang?
  • Simple examples
  • Function pointer lambdas
  • Standard library function accepting lambdas

List Comprehension

  • What is list comprehension?
  • Iterators
  • Mappers
  • Filters
  • Patterns
  • The fun history behind this language construct

Records

  • What is an Erlang record?
  • What is the purpose of it?
  • Syntax
  • Immutability
  • Definition
  • Instantiation
  • Getters
  • Setters

Concurrent Programming

Multi-Threaded Computing

  • Single-threaded vs. multi-threaded computation
  • Terminology
  • Time sharing
  • Scheduling forms
  • Thread types

Erlang Threads (Processes)

  • The concurrency model of Erlang
  • Creating a thread
  • BIFs for threads
  • Single-task thread
  • Looping thread

Messages

  • The Erlang message passing model
  • What is a message?
  • Sending a message
  • Receiving messages
  • Receive patterns
  • Brief about heap storage and messages
  • Asynchronous send
  • Decoding different message types
  • Guarded receive
  • Dealing with timeout
  • Static name of a thread
  • Registering a thread name

Rendezvous

  • What is a rendezvous send?
  • Handshaking send
  • Extended rendezvous

Dynamic Code Upgrades

  • How is run-time upgrades handled?
  • Sample upgradeable server
  • Use-case

Linked Threads

  • How an Erlang system can be fault-tolerant
  • The principle of linked threads
  • How to link two threads
  • Crashing the Erlang shell
  • Catching EXIT signals
  • Exceptions
  • Throwing an exception expression
  • Simple catch
  • The try-catch expression
  • Supervision
  • EXIT propagation semantics
  • Sample supervisor thread
  • Sample supervised server thread
  • Sample client API

Development

Command-Line

  • Understanding the code-path
  • The lib-path
  • Environment variable configuration
  • Compilation within the shell
  • Compilation at the command-line
  • Command-line execution
  • Handling command-line arguments

Erlang Pre-Processor

  • Purpose of the pre-processor
  • Macro constants
  • Macro functions
  • Macro conditionals
  • Include files
  • System include files

Generate API Documentation

  • What do we mean with API docs?
  • JavaDoc vs. Edoc
  • Module tags
  • Functions tags
  • Type specification
  • Macros
  • Overview page
  • Running edoc

Anti-Patterns i Erlang

This chapter describes various thing to avoid in Erlang, or how to crash the Erlang system

  • Parameter hazard
  • Unbounded recursion
  • Ping-pong recursion
  • Zombie threads
  • Overflowed mailbox
  • Under-dimensioned message flow-control
  • The problem of mutable shared state
  • How to violate the Erlang messaging model
  • Lessons learnt

Communication

Working with Files

  • Opening & closing files
  • What is a file, really, in Erlang?
  • Reading from files
  • Reading text files, line-wise
  • Writing to files
  • Formatted I/O
  • File system operations
  • File name operations
  • Directory operations
  • Running external commands

Working with External Applications (Ports)

  • What is a port in Erlang?
  • Opening a port
  • Sending data to a port
  • Receiving data from a port
  • Obtaining port meta-data

TCP Communication

  • Brief about TCP
  • Simple TCP client
  • Performing HTTP calls
  • Simple TCP server

Distributed Erlang

  • How to run an Erlang application over multiple computers
  • Terminology
  • Node names
  • Sending remote messages
  • Supervision

OTP

Basic OTP

  • The background & history of OTP
  • OTP artifacts
  • Purpose
  • IoC
  • OTP run-time structure
  • Prescribed project directory structure

OTP Application

  • Specification (*.app file)
  • Application controller
  • Information accessors
  • Application module
  • Supervisor
  • Restart configuration
  • Worker configuration
  • Dynamic number of workers
  • Compilation
  • Execution

Generic Server

  • Generic server skeleton
  • Life-cycle invokers
  • Life-cycle call-backs
  • Communication invokers
  • Rendezvous handlers
  • Async handlers
  • Two-phase rendezvous
  • OTP tools

Outside Core Erlang

Using open-source libraries in Erlang

  • Resources
  • Incorporation
  • Build

Overview of some libraries

  • Awesome Erlang
  • Testing
  • Logging
  • HTTP oriented
  • Web frameworks
  • Database access
  • Queue servers

Brief about Elixir

  • Why was Elixir created
  • What is the relation between Erlang and Elixir
  • Brief about its syntax
  • A few comparative examples