The University of Kent
School of Computing

Erlang master classes

These three Master Classes in Erlang will show you how Erlang can be used in practice to solve larger problems. We have chosen to give examples that provide 'capstones' for different aspects of Erlang: functional programming, concurrent programming and larger-scale programming with OTP.

The master classes are presented by Joe Armstrong, Ericsson AB and KTH, Stockholm, and one of the inventors of Erlang; Francesco Cesarini, CTO and founder of Erlang Solutions Ltd; and Simon Thompson, functional programming teacher and researcher at the University of Kent. Each Master Class ends with a discussion between the three presenters on some of the issues raised by the Master Class.

 

Filming of the Erlang master classes

Content Block Header Image

Francesco Cesarini, Simon Thompson and Joe Armstrong film a disscussion video

 

Kent Master Classes



To celebrate the university's 50th anniversary, it has funded Beacon Projects [1] that will both highlight the university's successes and point to where it might go in the future. Our K-MOOCs Beacon Project [2] aims to highlight our strengths in Erlang and functional programming by developing online learning materials and courses, including these Master Classes. These Master Classes give an opportunity to explore how concepts are used in the 'real world', with contributions not just from leading academics but also from our partners within business, government and industry. The Master Classes go beyond an introductory presentation of ideas to include larger scale examples and case studies.

The Master Classes are multi-purpose. As well as being stand alone presentations, they fit into an introductory online course (or MOOC) by giving capstones to sections of the course. The classes and MOOC materials are also usuable in campus-based programmes, as well as stand alone. These particular Master Classes form a component of our pilot MOOC in 'Functional Programming with Erlang'.

 

Functional Programming, with Simon Thompson


In this first master class we look at language processing in general, and in particular we focus on processing arithmetical expressions in a language like Erlang; of course, this is a model for processing all sorts of other languages: XML, domain-specific languages, test and “make” systems and so on. Once a representation is established, we show how this representation can be interpreted, or compiled and run on a virtual machine. Expressions can also be simplified symbolically, as well as converted to and from a textual form.

Simon Thompson

Simon Thompson portrait

Simon [9] is Professor of Logic and Computation at the University of Kent. He has been a teacher and researcher in functional programming for most of his career. Recent research has concentrated on refactoring programs in Erlang and Haskell, and he is the author of textbooks on Erlang (with Francesco), Haskell, Miranda and type theory.

Videos:

Playlist of all Master class 1 videos [10]

Introduction to language processing [11]
Representing structured data [12]
Using recursion: pretty printing [13]
Evaluation expressions [14]
Compiling and running on a virtual machine [15]
Parsing [16]
Simplification [17]
Discussion [18]

Supporting resources:

expr.erl [19]

back to top [20]

Concurrent Programming, with Joe Armstrong


Erlang is best known for its “share nothing” concurrency model that supports separate lightweight processes that communicate by message passing. This master class shows how sequential code – from the expression example – can be made concurrent. Building on this is a discussion of patterns for systems built on communicating processes. Erlang is built to be fault tolerant, and its “let if fail” philosophy is supported by its approach to process errors. Key to the successful use of Erlang in practice is the recognition that many of the components that programmers naturally build – for example servers – follow a similar pattern, and this is illustrated by making a more generic version of the calculator, serving as a bridge to the final master class.

Joe Armstrong

Joe Armstrong portrait

Joe [21] is one of the “gang of three” Erlang inventors, and a champion of the Erlang approach to programming large complex systems. He has worked for Ericsson, as well as in startups, and is also professor at KTH, Stockholm. He is the author of Programming Erlang (2ed).

Videos:

Playlist of all Master class 2 videos [22]

Turning sequential code into concurrent code [23]
Abstracting patterns of concurrency [24]
Handling errors [25]
The road to generics [26]
Client-server: name-server and resolver [27]
Discussion [28]

Supporting resources:

calc.erl [29]
gen_server_lite.erl [30]
client1.erl [31]
lecture2.erl [32]
counter0.erl [33]
par_server.erl [34]
counter1.erl [35]
server1.erl [36]
demo1.erl [37]
triv_tcp_fac_client.erl [38]
demo1_1.erl [39]
triv_tcp_fac_server.erl [40]
demo2.erl [41]
triv_tcp_name_server.erl [42]
demo2_1.erl [43]
triv_tcp_resolver.erl [44]
elib.erl [45]

back to top [46]

OTP Behaviours and Releases, with Francesco Cesarini


There is a lot more to Erlang than the language – there is a wide ecosystem of tools, for example – but the key productivity tool is OTP (the Open Telecom Platform), which provides generic behaviours, such as a generic server, that can be used again and again with no changes to the generic part. This is explored in depth in this master class, and it is shown how, together with supervision, OTP provides the behaviours from which complex systems can be built quickly and reliably. These systems are packaged as applications and releases, and an overview of these completes the final master class.

Francesco Cesarini

Francesco Cesarini portrait

Francesco [47] is founder and Technical Director of Erlang Solutions Ltd, the company focused on building scalable, reliable systems based on Erlang/OTP. ESL is based in the UK and has branches in Sweden, Poland, Hungary, USA and Argentina. Francesco is also author (with Simon) of Erlang Programming and the forthcoming Designing for Scalability with Erlang/OTP with Steve Vinoski.

Videos:

Playlist of all Master class 3 videos [48]

Client-servers [49]
What’s in a message? [50]
Generic servers [51]
Supervisors [52]
Applications [53]
Discussion [54]

Supporting resources:

General:
calc_gen.erl [55]
expr.erl [56]
client1.erl [57]
server1.erl [58]

Applications:
calc.erl [59]
calc_sup.erl [60]
calc_app.erl [61]
expr.erl [62]

Behaviours:
calc.erl [63]
expr.erl [64]

Gen_servers:
calc.erl [65]
expr.erl [66]

Server:
calc.erl [67]
server.erl [68]
expr.erl [69]

Supervisors:
calc.erl [70]
expr.erl [71]
calc_sup.erl [72]

Links

  1. http://www.kent.ac.uk/beacon/
  2. http://www.kent.ac.uk/elearning/themes/kmoocs.html
  3. javascript:void(null);
  4. javascript:void(null);
  5. javascript:void(null);
  6. https://www.cs.kent.ac.uk/ErlangMasterClasses/#Master%20class%201
  7. https://www.cs.kent.ac.uk/ErlangMasterClasses/#class2
  8. https://www.cs.kent.ac.uk/ErlangMasterClasses/#class3
  9. http://www.cs.kent.ac.uk/people/staff/sjt/
  10. https://www.youtube.com/playlist?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  11. https://youtu.be/gKRyAb7d8lo
  12. https://youtu.be/I3O2wjPXMo4?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  13. https://youtu.be/gtSOqxvoK0c?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  14. https://youtu.be/N2lg36hfvKo?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  15. https://youtu.be/ZfC7fjgh5hI?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  16. https://youtu.be/GgD4XpGCd0E?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  17. https://youtu.be/Bpmf7b75gho?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  18. https://youtu.be/K8nxTSPHZhs?list=PLR812eVbehlwEArT3Bv3UfcM9wR3AEZb5
  19. https://www.cs.kent.ac.uk/ErlangMasterClasses/expr.erl
  20. https://www.cs.kent.ac.uk/ErlangMasterClasses/#topOfPage
  21. http://joearms.github.io/
  22. https://www.youtube.com/playlist?list=PLR812eVbehlwq4qbqswOWH7NLKjodnTIn
  23. https://youtu.be/nYgEny1goCY?list=PLR812eVbehlwq4qbqswOWH7NLKjodnTIn
  24. https://youtu.be/0jsdXFUvQKE?list=PLR812eVbehlwq4qbqswOWH7NLKjodnTIn
  25. https://youtu.be/ZOsvgwOR6G0?list=PLR812eVbehlwq4qbqswOWH7NLKjodnTIn
  26. https://youtu.be/RFBCVY-6A98?list=PLR812eVbehlwq4qbqswOWH7NLKjodnTIn
  27. https://youtu.be/75g_MGhwd_4?list=PLR812eVbehlwq4qbqswOWH7NLKjodnTIn
  28. https://youtu.be/VXuYptzqYLY?list=PLR812eVbehlwq4qbqswOWH7NLKjodnTIn
  29. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/calc.erl
  30. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/gen_server_lite.erl
  31. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/client1.erl
  32. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/lecture2.erl
  33. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/counter0.erl
  34. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/par_server.erl
  35. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/counter1.erl
  36. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/server1.erl
  37. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/demo1.erl
  38. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/triv_tcp_fac_client.erl
  39. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/demo1_1.erl
  40. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/triv_tcp_fac_server.erl
  41. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/demo2.erl
  42. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/triv_tcp_name_server.erl
  43. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/demo2_1.erl
  44. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/triv_tcp_resolver.erl
  45. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%202%20resources/elib.erl
  46. https://www.cs.kent.ac.uk/ErlangMasterClasses/#topOfPage
  47. https://twitter.com/francescoc
  48. https://www.youtube.com/playlist?list=PLR812eVbehlx6vgWGf2FLHjkksAEDmFjc
  49. https://youtu.be/9HVvzSsdW9k?list=PLR812eVbehlx6vgWGf2FLHjkksAEDmFjc
  50. https://youtu.be/upGZMJBh81A?list=PLR812eVbehlx6vgWGf2FLHjkksAEDmFjc
  51. https://youtu.be/MRZVloyV0H8?list=PLR812eVbehlx6vgWGf2FLHjkksAEDmFjc
  52. https://youtu.be/q3WUAOZwinw?list=PLR812eVbehlx6vgWGf2FLHjkksAEDmFjc
  53. https://youtu.be/mnAEcuVY010?list=PLR812eVbehlx6vgWGf2FLHjkksAEDmFjc
  54. https://youtu.be/0i1WUVANr3o?list=PLR812eVbehlx6vgWGf2FLHjkksAEDmFjc
  55. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/calc_gen.erl
  56. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/expr.erl
  57. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/client1.erl
  58. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/server1.erl
  59. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/applications/calc.erl
  60. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/applications/calc_sup.erl
  61. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/applications/calc_app.erl
  62. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/applications/expr.erl
  63. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/behaviours/calc.erl
  64. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/behaviours/expr.erl
  65. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/gen_servers/calc.erl
  66. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/gen_servers/expr.erl
  67. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/server/calc.erl
  68. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/server/server.erl
  69. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/server/expr.erl
  70. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/supervisors/calc.erl
  71. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/supervisors/expr.erl
  72. https://www.cs.kent.ac.uk/ErlangMasterClasses/Erlang%20Master%20Class%203%20resources/supervisors/calc_sup.erl

School of Computing, University of Kent, Canterbury, Kent, CT2 7NF

Enquiries: +44 (0)1227 824180 or contact us.

Last Updated: 01/07/2015