Appendices
Syntax cheat sheet, reserved words, frequently used BIFs (auto-imported from erlang), VM flags quick reference, learning resources and suggested study plan (12 weeks).
Appendices
45.1 Syntax cheat sheet 45.2 Reserved words after and andalso band begin bnot bor bsl bsr bxor case catch cond div else end fun if let maybe not of or orelse receive rem try when xor
45.3 Frequently used BIFs (auto-imported from erlang) abs, apply, atom_to_binary, atom_to_list, binary_to_term, byte_size, element, erase, error, exit, float, get, hd, integer_to_list, is_*, length, link, list_to_atom, list_to_tuple, make_ref, map_get, map_size, max, min, monitor, node, nodes, now (deprecated), open_port, put, register, round, self, setelement, size, spawn, spawn_link, spawn_monitor, split_binary, term_to_binary, throw, tl, trunc, tuple_size, tuple_to_list, unlink, unregister, whereis.
45.4 VM flags quick reference -sname / -name -s M F / -eval Expr run at startup -noshell / -detached no shell / background -config file +JPperf true JIT perf maps (profiling) -proto_dist inet_tls 45.5 Learning resources
Official: erlang.org/doc (Getting Started, Reference Manual, OTP Design Principles, Efficiency Guide, System Principles)
*Learn You Some Erlang for Great Good!* — Fred Hébert (free online: learnyousomeerlang.com)
*Programming Erlang* (2nd ed.) — Joe Armstrong *Erlang Programming* — Francesco Cesarini & Simon Thompson
*Erlang and OTP in Action* — Logan, Merritt & Carlsson *Designing for Scalability with Erlang/OTP* — Cesarini & Vinoski
*Property-Based Testing with PropEr, Erlang, and Elixir* — Fred Hébert
*Erlang in Anger* — Fred Hébert (free; production debugging)
*Adopting Erlang* — Hébert, Tristan Sloughter, Bryan Paxton (free online)
*The BEAM Book* — Erik Stenman (free online; VM internals) Joe Armstrong's thesis: *Making reliable distributed systems in the presence of software errors* (2003)
Practice: Exercism Erlang track, Advent of Code, Erlang Koans
Community: erlangforums.com, Erlang Ecosystem Foundation (erlef.org), Code BEAM conferences, Erlang Slack/Discord 45.6 Suggested study plan (12 weeks) Install, shell, data types, operators
Pattern matching, modules, guards, recursion Funs, comprehensions — Part I exercises Lists, records, maps, strings, binaries
Errors, data structures, macros, specs, I/O rebar3, testing, docs — Part II exercises, Project 1
Processes, links, monitors, patterns — Project 2 gen_server, supervisors, applications — Project 3 gen_statem, gen_event, ETS, Mnesia
Distribution, networking, ports/NIFs — Project 4 Releases, hot upgrades, tracing, BEAM internals, modern features
Cowboy, stdlib, interop, best practices — Project 5 or 6 🎓 Final Words
You now have the complete map of Erlang: from pattern matching and recursion to processes, OTP behaviours, supervision trees, distribution, hot code upgrades, and BEAM internals. As Joe Armstrong put it, the world is concurrent — model your programs the same way. Read *Learn You Some Erlang* alongside this course, build the capstone projects, and study real systems like RabbitMQ and Cowboy. Happy hacking! ☎️
%% Module
-module(m).
-export([f/1]).
-record(r, {a = 0, b}).
-define(MAX, 10).
%% Functions & clauses
f(0) -> zero;
f(N) when N > 0, is_integer(N) -> positive;
f(_) -> other.
%% Data
Atom = ok, Tuple = {a, 1}, List = [1, 2 | [3]], Str = "abc", Bin = <<"abc">>,
Map = #{k => v}, Map2 = Map#{k := v2}, Rec = #r{b = 1}, Rec#r.a,
Fun = fun(X) -> X + 1 end, Fun(1), F2 = fun lists:sum/1.
%% Control
case X of {ok, V} -> V; _ -> none end,
if X > 0 -> pos; true -> nonpos end,
maybe {ok, A} ?= g(), {ok, A} else E -> E end,
try g() of V -> V catch error:R:St -> {R, St} after done() end.
%% Comprehensions
[X * 2 || X <- L, X > 0],
<< <<B>> || <<B>> <= Bin >>,
#{K => V || K := V <- Map}.
%% Processes
Pid = spawn(fun() -> loop() end),
Pid ! msg,
receive msg -> ok after 1000 -> timeout end,
link(Pid), Ref = monitor(process, Pid), register(name, Pid).
%% OTP
gen_server:call(Server, Req), gen_server:cast(Server, Msg),
supervisor:start_child(Sup, Spec), application:ensure_all_started(App).