tadasajon

tadasajon

I am going to try to state my understanding of the distinction between OTP and the BEAM here below. Please comment if you think I got anything wrong, glossed over something important, or missed some aspect of either one.

Here goes…

The EAM in BEAM stands for “Erlang Abstract Machine”, so the BEAM is is just a virtual machine for executing erlang code, which compiles into BEAM-byte-code. So the BEAM is analogous to the JVM, if you’re familiar with the Java world: it is a virtual layer between the programming paradigm and the underlying hardware.

The BEAM is is an actual executable program that has to be installed on a physical machine and fired up. Once it is running, the BEAM is fed BEAM-byte-code, which is what Erlang and Elixir programs compile into, and the BEAM then translates this byte-code into machine-executable-code which the underlying hardware then executes.

OTP, on the other hand, is a set of behaviors, which are implemented in a library that has been installed on top of the BEAM. OTP is basically API contracts for writing software according to well-tested software architecture principles for working with a purely functional language in an environment in which processes are isolated and cheap and message passing is the only means of process communication – which is the architecture enforced by the BEAM.

So BEAM is the abstract machine which enforces a set of rules, and OTP is a set of principles for best executing code and writing software according to the rules enforced by the BEAM.

I guess my only question is: which one of these is more stable and how often do they change? I’ve noticed that asdf gives the following output in response to the command asdf list all elixir:

1.13.4
1.13.4-otp-22
1.13.4-otp-23
1.13.4-otp-24
1.13.4-otp-25
1.14.0-rc.0
1.14.0-rc.0-otp-23
1.14.0-rc.0-otp-24
1.14.0-rc.0-otp-25

So I guess OTP is constantly being updated, perhaps in response to incremental updates made to the BEAM.

Also, I guess the actual BEAM executable code is packaged with erlang, which has to be installed as a dependency of elixir?

Showing Posts 1 to 5

ityonemo

ityonemo

You got beam correct, OTP is like “standard library” for the beam.

lpil

lpil

Creator of Gleam

I would say that the Erlang standard library is the standard library. OTP is an application framework that also is included in the Erlang distribution, and you could choose not to use it if you like.

Although perhaps unhelpfully OTP seems to also the name of the distribution, or at least it is the name of the code repository.

AstonJ

AstonJ

This thread is worth a read re OTP :023:

ityonemo

ityonemo

Yeah things I would call OTP (like gen_server) are explicitly under the heading STDLIB in the Erlang docs. Otoh, something like tftp, xmerl… I think that’s in otp? But I would not want to call that STDLIB… (Though I guess python stdlib has lots of weird batteries included), there’s some cringey otp that probably should be considered stdlib (httpc) and some stuff that definitely should (crypto), even though both do not fall explicitly in the STDLIB heading

dimitarvp

dimitarvp

BEAM is the runtime for Erlang, like the JVM is a runtime for for Java, and like CLR is for C#.

OTP is a library written in Erlang. When ran, it runs inside the BEAM, like all other Erlang code.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4663 61218 595
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
515 12931 101
New
sntran
In my third year of college, around 2010, I found Erlang. A few years later, I found Elixir. I liked the ideas at once: many small proces...
New
gtcode
I’ve been tinkering with Lynx (by José) via hold_ledger. I used AI to write the code, a separate specification, the tests, and the Lean p...
New
AstonJ
A remark @Garrison made… ..has already inspired a thread for the technical side of reclaiming our internet, but there is of course anot...
New
ManuelGarcia
Hi everyone! I’m the developer of PaperForge, and I’ve been working on something alongside it that I’d like your opinion on. I’m conside...
New
bartblast
This is where the projects in the Hologram Showcase get posted: apps built with Hologram and libraries made for it. New ones go up usuall...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
261 13183 112
New
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
kip
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
charlenopires
Hi everyone :waving_hand: I’ve been working on PhiaUI, an open-source UI component library for Phoenix LiveView, and I wanted to share i...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews