Erlang Express 3-5 March

Trainer: Robert Virding

Target Audience: Software Developers

Prerequisites: Good programming skills in another language

Objectives:

• Understanding of the basics of Erlang.

• Read/Write/Design Erlang Programs.

• Good knowledge of the development environment and tools.

• Provides basics needed to attend the Advanced Erlang/OTP course

Goal: Attend the Advanced Erlang/OTP course and eventually pass the Erlang certification exam.

Duration: Three days

Registration: 08:30 on 3 March 2014

Venue: Marines' Memorial Club and Hotel

Description: The course contains all the Erlang basics such as sequential and concurrent programming, along side error handling. The Erlang development environment is presented, with a special emphasis on the Erlang mode for Emacs alongside the major debugging tools. Good and bad programming practices are discussed, as are tools used to profile the system. OTP design principles and concepts are sneaked into the material as well as the exercises.

Course Contents:

Introduction 

Basic Erlang 

Sequential Programming 

Concurrent Programming 

Process Design Patterns 

Process Error Handling 

Code Updating 

ETS tables 

Distributed Programming 

Ports and Sockets

 

Introduction 

Introduction to the software needs of telecom control systems, followed by a history of Erlang, its features, and product and research examples within and outside Ericsson.

Basic Erlang 

This section deals with Erlang data types and pattern matching. Functions, modules, and BIFs are discussed. Before the exercises, the Erlang shell, useful shell commands as well as Emacs and its Erlang mode are introduced.

Sequential Programming 

The Sequential Programming section comprehends conditional evaluations, guards and scope of variables. It then introduces recursion, with a special emphasis on different recursive patterns, tail recursion, and space saving optimizations. Before the exercises, libraries and their manual pages, possible run time errors and the debugger are demonstrated. 

Concurrent Programming 

This section describes the creation of processes and their life span. It looks at sending and receiving messages, selective reception, and passing data in the messages. It continues with the various uses of time outs and registering processes, and terminates by showing the generic process code structure. Before the exercises, a demonstration of the Process Manager tool is given. 

Process Design Patterns 

This section introduces the concept of process patterns, preparing the students for the OTP behaviours. It gives a detailed example of a client server system, looks at finite state machines and event handlers. Synchronous versus asynchronous message passing is discussed. 

Process Error Handling 

This section introduces the simple but powerful error handling mechanisms in processes. It looks at process links, exit signals and their propagation semantics. How robust systems are built in Erlang are discussed, and an example from the Process Design Patterns section is re-implemented, making it robust.

Code Updating 

The section introduces software upgrade during run time. The error handler, the code server, and code search paths are covered, as is the .erlang file. 

ETS tables 

An introduction to the Erlang Term Storage is given, together with its different table options. Examples on when to use and not to use ETS tables are covered. A demonstration of the table visualizer is provided. 

Distributed Programming 

An introduction to the requirements of distributed systems is given, and how Erlang is able to fill these requirements. The distribution syntax and semantics are covered, followed by the BIFs and the net kernel. 

Ports and Sockets

An introduction of the mechanisms used to make Erlang more open are taken up in this section. Ports, for external communication within the same machine, and Sockets, for communication on IP networks are discussed. The difference between TCP and UDP is described.

 

Cowboy Express 3-5 March

Trainer: Loic Hoguin

Target Audience: Software Developers

Prerequisites: Basic Erlang knowledge, Linux or OSX, Erlang R16+

Objectives:

  *  Write efficient Websocket applications

  *  Master REST services

  *  Understand the Cowboy internals

  *  Learn tricks to reach more than 1 million connections per servers

 

Registration: 08:30 on 3 March 2014

Venue: Marines' Memorial Club and Hotel

 

The course teaches everything there is to know about using the Cowboy HTTP server and writing applications for it. We will first go through the basics, reminisce about HTTP, how to start listening for connections and how to send static files or a reply dynamically. We will then move on to Websocket programming and write a distributed chat application. 

Then we will look at REST, understand what it means, when to use it and how. We will then create a REST based cache application using Cowboy and ets. Finally we will look together at the performance of the two applications we previously built and learn how we can achieve greater concurrency.

  *  Day 1: Introduction, Websocket part 1

  *  Day 2: Websocket part 2, REST part 1

  *  Day 3: REST part 2, Advanced topics

Introduction

This section gets you started with Cowboy and shows how to start listeners, send files, send replies from Erlang code and various beginner subjects. It should be pretty easy to understand and serves as getting you ready for the rest of the training. 

Websocket part 1

This section starts by explaining how Websocket works, and what you can do with it. We then start working on building our chat service, first by making it work on a single server. We will then discuss how to make that application distributed, leaving you the evening to come up with solutions. 

Websocket part 2

This section shows how to make the chat application distributed, answering any questions that may have arisen after the first day. 

REST part 1

This section defines REST and teaches you how to use it. We will write the bases of a cache server, then make it auto-discoverable and write a small REST client that works without any previous knowledge about the service. Then we will talk about making that server more useful, leaving you the evening to finish it.

REST part 2

This section finishes the server, making sure everyone has an equivalent application, and answering any remaining questions.

Advanced topics

This section shows how to reach high number of connections with our chat service, and how to reach high throughput with our cache service. We will go through Cowboy internals and debugging tricks to get the most out of it. We will finish with a final discussion on everything we did during the training, answering any remaining questions.

 

Concuerror 1.0   4-Hour Tutorial 8 March

Trainer: Kostis Sagonas

Target Audience: Developers

Duration: 4 Hours

Registration: 8:45 on 8 March 2014

Venue: Marines' Memorial Club and Hotel


We will present a demonstrate Concuerror, an open source systematic testing tool for finding concurrency errors in Erlang programs or verify their absence. Concuerror supports the test-driven development of concurrent Erlang programs in order to detect early and eliminate the vast majority of concurrency-related errors (e.g. data races, unexpected crashes, deadlocks, etc.) that may occur in their execution. A salient feature of Concuerror is that it is completely automatic, works out of the box with existing test suites, and incorporates various optimizations that significantly reduce the time it takes to explore all process interleaving. The tool clearly shows execution traces that lead to errors and can deterministically replay them. We will also briefly review concurrency errors that Concuerror has detected in Erlang applications and standard Erlang/OTP libraries.

Elixir 4-Hour Tutorial 8 March

Trainer: Robert Virding

Target Audience: Developers

Prerequisites: Basic Linux or OSX, another scripting or programming language

Duration: 4 Hours

Registration: 8:45 on 8 March 2014

Venue: Marines' Memorial Club and Hotel

Description:  Elixir is a functional, meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax and macro support that leverages Erlang's abilities to build concurrent, distributed and fault-tolerant applications with hot code upgrades and it also provides first-class support for pattern matching, polymorphism via protocols (similar to Clojure's), aliases and associative data structures (usually known as dicts or hashes in other programming languages). Finally, Elixir and Erlang share the same bytecode and data types. This means you can invoke Erlang code from Elixir (and vice-versa) without any conversion or performance hit. This allows a developer to mix the expressiveness of Elixir with the robustness and performance of Erlang.

This tutorial will present an introduction to Elixir for experienced programmers and show  its strengths and how it can be used to build concurrent and fault-tolerant applications.

OTP Express 10-12 March

Trainer: Robert Virding

Target Audience: This course is aimed at experienced Erlang Software Developers and Designers who need to understand Behaviours.

Prerequisites: Existing experience using Sequential and Concurrent Programming with Erlang on projects.

Objectives:

• Use existing Design Patterns supported by Erlang and OTP.

• Apply Generic Behaviours, Finite State Machines and Event handler Patterns.

• Use the Supervisor and Applicaton Behaviours Patterns.

• Write your own Design Patterns.

• Structure large Erlang based systems.

Goal: Design fault-tolerant systems.

Duration: Three days

Registration: 08:30 on 10 March 

Venue: Marines' Memorial Club and Hotel

Description:

You will learn the prevailing Erlang Design Patterns called OTP Behaviours. We will cover Erlang Design Patterns such as Generic Behaviours, Finite State Machines and Event Handlers. You will also learn how to develop systems using the Supervisor and Application Behaviours Patterns, so you can construct maintainable and fault tolerant software. Upon completion of this course, you will be able to extend it all, by devising your very own Behaviours.

 

Introduction

This section introduces the need and advantages of using middleware in the developmentof massively concurrent, distributed, fault tolerant real time systems in Erlang. It looks at Erlang's evolution, and how it helped form OTP. Further this gives an overview of the components that make up OTP. They are Erlang, a set of behaviours, and rules and design principles to use them. OTP comes with many ready built applications and tools useful for large scale software design. They are introduced in this section.

Behaviours

Erlang processes display similar properties. In the Open Telecom platforms, these properties have been abstracted in a group of generic library modules, also called OTP behaviours. This section introduces the concept of behaviours, and through examples of abstraction, shows their need and advantages.

Generic Servers

Generic servers implement the Client-Server behaviours in OTP. This section introduces the most commonly used behaviour in Erlang based applications.

Finite State Machines

The finite state machines behaviour in Erlang is used to implement state transitions in processes based on incoming events. This behaviour is commonly used when implementing protocol stacks.

Supervisors

Supervisors are a behaviour whose only task is to start other Erlang behaviours and monitor them for abnormal termination. This is a vital section in understanding start and restart strategies in Erlang.

Event Handlers

Erlang has ready built event managers. Event handlers are behaviours who subscribe to events sent to specific managers, allowing several actions to take place based on one single event. Event handlers can be changed on the fly, as well as added or deleted from a specific manager.

Applications

This section introduces the application behaviour, used for packaging Erlang resources. Resources can vary from libraries to process clusters, and can be configured to run on a single processor or be distributed on a set of nodes.

Special Processes

There will be times where we want to implement our own behaviours, or for efficiency reason, use simple Erlang processes. This section looks behind the scenes on how behaviours are implemented, and explains how to implement your own.

System Principles

The System Principles section describes how Erlang applications are coupled together in a release and started as a whole. Sections include creating release files, bundling up the software including the virtual machine, and running Erlang on target and embedded hosts.

 

Kazoo 10-12 March

Trainer: James Aimonetti

Target Audience: Developers and Ops

Prerequisites: 

The focus will be on leveraging Kazoo to build applications; as such, we won't focus too heavily on teaching Erlang. Please come with some experience using Erlang, exposure to OTP principles and patterns, and preferably having used some of the more popular Erlang libraries (lager, Cowboy, poolboy, etc). General telephony/VoIP experience welcome but not required. Basic Linux sysadmin experience as well.

Objectives:

The participant will get an intro to the Kazoo code base and how to build applications, leveraging existing libraries and subsystems included in the platform.

Duration: Three days.

Registration: 8:30 on 10 March 2014.

Venue:  Marines' Memorial Club and Hotel in Union Square. 

Description:  Want to learn how to write applications for the most flexible, scalable, and advanced telephony platform, Kazoo? This two-day, hands-on course will take you through the platform, starting with the libraries, utilities, behaviors, and patterns developed over the last three years to get you going on the right track. From there, we'll journey into the existing applications so you can see design decisions that worked, that didn't worked, and the tradeoffs to consider when you take the reigns to build your own application. 

The course will cover topics such as using the AMQP behavior, gen_listener, to consume messages off the AMQP bus; using the BigCouch utilities to query, create, and delete databases, documents, and views; basic Erlang application structure to build new Kazoo applications; and so much more!

We will have a variety of fun "toy" applications you can choose from for the final project, but if you have ideas for your own application, we encourage you to bring those ideas and see if you can get a prototype together before you leave.