OTP is the framework layer of the Erlang development platform, complementing the language, BEAM virtual machine, and development tools. It abstracts concurrency, distribution, error recovery, libraries, deployment, live updates, and other production concerns. section 1.1.4
Its abstractions turn stateful server processes into reusable components. GenServer reduces boilerplate around recursion, state management, and message passing while fitting larger systems that handle runtime errors, logging, events, and upgrades. section 6.0 section 1.1.4
OTP also defines how applications are packaged and started:
- An OTP application describes its name, version, modules, dependencies, and optional application callback. section 11.1.1
- Mix generates the application resource and can create a supervision-enabled project with mix new hello_world --sup. section 11.1.1
- Starting iex -S mix launches the application alongside its runtime dependencies. section 11.1.1
iex(1)> Application.started_applications()
[
{:iex, ~c"iex", ~c"1.15.0"},
{:hello_world, ~c"hello_world", ~c"0.1.0"}, #1
{:logger, ~c"logger", ~c"1.15.0"},
{:mix, ~c"mix", ~c"1.15.0"},
{:elixir, ~c"elixir", ~c"1.15.0"},
{:compiler, ~c"ERTS CXC 138 10", ~c"8.3"},
{:stdlib, ~c"ERTS CXC 138 10", ~c"5.0"},
{:kernel, ~c"ERTS CXC 138 10", ~c"9.0"}
]
Inspect the running applications reported by Application.started_applications/0, including the generated hello_world application and its runtime dependencies. section 11.1.1
