Skip to content

Commit 6e13c0a

Browse files
author
happi
committed
Add cover and publishing assets
1 parent 198197b commit 6e13c0a

13 files changed

Lines changed: 249 additions & 136 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ beam-book.pdf
1616
beam-book-a4.pdf
1717
beam-book.epub
1818
beam-book-publish.pdf
19+
back_of_cover.pdf
20+
back_jacket.pdf
1921
opcodes_doc.asciidoc
2022
.#.gitignore
2123
genop.tab

README.md

Lines changed: 62 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,56 @@
1-
![Pages Build](https://github.com/happi/theBeamBook/actions/workflows/gh-pages.yml/badge.svg)
1+
![Pages Build](https://github.com/happi/theBeamBook/actions/workflows/gh-pages.yml/badge.svg)
22
![PDF Build](https://github.com/happi/theBeamBook/actions/workflows/build-pdf.yml/badge.svg)
33

44
[Download latest PDF](https://github.com/happi/theBeamBook/releases/latest/download/beam-book-a4.pdf)
55

66
# The BEAM Book
77

8-
**1.0 — First Edition now *in print***
8+
This repository contains the latest free and open edition of The BEAM Book,
9+
a deep dive into the internals of the Erlang runtime system and its virtual
10+
machine, the BEAM.
911

10-
Grab the tree‑ware from your local Amazon store:
12+
The current open edition is **1st Edition** (2025), licensed under CC BY 4.0.
1113

12-
* 🇺🇸 [US](https://www.amazon.com/dp/9153142535)
13-
* 🇬🇧 [UK](https://www.amazon.co.uk/dp/9153142535)
14-
* 🇩🇪 [DE](https://www.amazon.de/dp/9153142535)
15-
* 🇸🇪 [SE](https://www.amazon.se/dp/9153142535)
14+
You can read the book as a [PDF](https://github.com/happi/theBeamBook/releases/latest),
15+
[browse it online](https://happi.github.io/theBeamBook/), or read the
16+
AsciiDoc source directly on GitHub starting from [book.asciidoc](book.asciidoc).
1617

17-
This project documents the internals of the Erlang runtime system and its virtual machine, the **BEAM**.
18+
The printed edition is available on Amazon:
19+
[US](https://www.amazon.com/dp/9153142535) |
20+
[UK](https://www.amazon.co.uk/dp/9153142535) |
21+
[DE](https://www.amazon.de/dp/9153142535) |
22+
[SE](https://www.amazon.se/dp/9153142535)
1823

19-
You can read or download the book as a PDF (current stable release **1.0 – First Edition**) from the [latest stable release](https://github.com/happi/theBeamBook/releases/latest) or [browse it online](https://happi.github.io/theBeamBook/).
24+
## Edition Policy
2025

21-
The book is written in AsciiDoc and most chapters can be read directly from source on GitHub. Open [book.asciidoc](book.asciidoc) for a quick start.
26+
This book follows a rolling open model.
2227

23-
You can also read it as a [GitHub Pages site](https://happi.github.io/theBeamBook/).
28+
- The newest edition is published commercially.
29+
- The previous edition is released publicly in this repository.
30+
- Over time, all major editions become open.
31+
32+
This means the open version may lag behind the latest printed edition.
33+
The open version is stable and complete, but may not contain the newest
34+
chapters or revisions.
2435

2536
## Contributing
2637

27-
The goal is a collaborative, authoritative reference on the Erlang runtime system. Please contribute—this work is far from complete.
38+
Contributions are welcome. Raise an issue, comment on open threads, or
39+
open a pull request.
2840

29-
* Raise an issue, comment on open threads, or open a pull request.
30-
* All contributions fall under the project’s Creative Commons licence (see below).
41+
By submitting a pull request, you agree that your contribution is licensed
42+
under the same license as this repository (CC BY 4.0). Contributions may
43+
appear in future commercial editions of the book with attribution.
3144

3245
Each chapter can be in one of four states:
3346

34-
1. **Placeholder** — only a title and maybe an outline. Grab the matching issue and start writing.
35-
2. **First draft** — the text is mostly there but needs editing: missing content, clarity, diagram tweaks, etc.
36-
3. **Final draft** — typo‑hunting and polishing.
37-
4. **Done (for OTP X)** — until a newer OTP version changes things.
47+
1. **Placeholder** -- only a title and maybe an outline.
48+
2. **First draft** -- the text is mostly there but needs editing.
49+
3. **Final draft** -- typo-hunting and polishing.
50+
4. **Done (for OTP X)** -- until a newer OTP version changes things.
51+
52+
For larger rewrites, check the chapter's status and existing issues.
53+
Coordinate with any active authors before heavy edits.
3854

3955
### Style guide
4056

@@ -44,164 +60,74 @@ AsciiDoc constructs should render nicely in this order of priority:
4460
2. HTML output
4561
3. Direct view on GitHub
4662

47-
We’ll accumulate specific do’s and don’ts here as we learn what works.
48-
49-
#### Comments in AsciiDoc
63+
#### Linking to OTP source code
5064

51-
Each chapter starts with a comment marking its status (`// Placeholder`, `// First Draft`, etc.) and possibly a link to an issue that tracks next steps.
52-
53-
#### Linking to OTP/Erlang source code
54-
55-
Always link to a *tagged* OTP version, e.g.
65+
Always link to a tagged OTP version, e.g.
5666

5767
```
5868
link:https://github.com/erlang/otp/blob/OTP-19.1/erts/emulator/beam/erl_time.h[erl_time.h]
5969
```
6070

61-
#### Directory structure and build
71+
#### Directory structure
6272

63-
* Chapters live under `chapters/` in their own `.asciidoc` files (use `_` for word breaks).
64-
* Code samples go in `code/CHAPTERNAME_chapter/src` and are included via `ap-code_listings.asciidoc`.
65-
* Images sit in `images/`.
73+
- Chapters live under `chapters/` in their own `.asciidoc` files.
74+
- Code samples go in `code/CHAPTERNAME_chapter/src`.
75+
- Images sit in `images/`.
6676

6777
#### Tag conventions
6878

69-
* Chapters: `CH-…`
70-
* Parts: `P-…`
71-
* Sections: `SEC-…`
72-
* Figures: `FIG-…`
73-
* Appendices: `AP-…`
74-
* Code listings: `LISTING-…`
75-
76-
### Process
79+
- Chapters: `CH-...`
80+
- Parts: `P-...`
81+
- Sections: `SEC-...`
82+
- Figures: `FIG-...`
83+
- Appendices: `AP-...`
84+
- Code listings: `LISTING-...`
7785

78-
Found something odd or incorrect? Open an issue in the [tracker](https://github.com/happi/theBeamBook/issues).
86+
## Commercial Editions
7987

80-
Spotted a typo? File a quick PR.
88+
Printed and Kindle editions help fund continued work on this book.
89+
If you want the most recent version and professionally typeset formats,
90+
consider purchasing the latest edition.
8191

82-
For larger rewrites, check the chapter’s status and existing issues. Coordinate with any active authors before heavy edits.
92+
## Building the PDF locally
8393

84-
---
85-
86-
## Building the PDF locally from source
87-
88-
A `Makefile` builds both PDF and HTML. With dependencies installed, run:
94+
A `Makefile` builds both PDF and HTML. With dependencies installed:
8995

9096
```shell
91-
make
97+
bundle install
98+
bundle exec make pdf-a4
9299
```
93100

94-
Result: `beam-book.pdf` in the project root and an HTML copy under `site/`.
95-
96101
Docker users can avoid local installs:
97102

98103
```shell
99-
make docker-build # build the image
100-
make docker # build the book inside the container
104+
make docker-build
105+
make docker
101106
```
102107

103-
Devcontainer aficionados: open the repo in your IDE’s devcontainer and just run `make`.
104-
105108
### Manual dependencies
106109

107-
See platform‑specific instructions below if you prefer native builds.
108-
109110
#### Linux (Debian/Ubuntu)
110111

111112
```shell
112113
sudo apt install git rsync wget curl make \
113114
ruby ruby-dev default-jre \
114115
asciidoctor graphviz
115-
sudo gem install asciidoctor-pdf asciidoctor-diagram rouge
116-
make
116+
bundle install
117+
bundle exec make pdf-a4
117118
```
118119

119120
#### macOS + Homebrew
120121

121-
Build on macOS prior version 15
122-
123-
```shell
124-
brew install asciidoctor graphviz wget ditaa
125-
sudo gem install asciidoctor-pdf asciidoctor-diagram rouge
126-
make
127-
```
128-
129-
macOS 15 ships with ruby 2.6+ while rouge 4.5+ requires ruby 2.7+. Use following
130-
to install required tools and libraries
131-
132122
```shell
133123
brew install asciidoctor graphviz wget ditaa ruby
134-
```
135-
136-
This will install ruby 3.3+, but to avoid errors new ruby not added to PATH. To fix this
137-
add ruby to PATH manually in command shell (or add to shell's rc file):
138-
139-
```shell
140124
export PATH=$(brew --prefix ruby)/bin:$PATH
141-
```
142-
143-
Install required ruby libraries:
144-
145-
```shell
146125
bundle install
147-
```
148-
149-
and then run build pdf file with
150-
151-
```shell
152-
make
126+
bundle exec make pdf-a4
153127
```
154128

155129
## Licence
156130

157-
*The Erlang Runtime System* by **Erik Stenman** is licensed under **CC BY 4.0**. See [LICENSE](LICENSE) for details.
158-
159-
---
160-
161-
# A short and personal history of the book
162-
163-
I, Erik Stenman (Happi), started writing this book back in 2013.
164-
After twelve years of starts, stops, and rewrites, version 1.0
165-
ships—less because the BEAM has stopped evolving, and more because
166-
it felt time to draw a line in the sand.
167-
168-
At first, I was thinking of self‑publishing the book on my blog,
169-
but since English isn't my native language, I felt I needed help
170-
from a good editor.
171-
172-
I managed to get a deal with O'Reilly and started converting my
173-
outline to their build process. My original plan was for a very long
174-
and thorough book, which the editor felt would get few readers. I
175-
started cutting my content and tried to write more of a tutorial than
176-
a manual. Unfortunately, progress was slow, and pre-sales were even
177-
slower, and the publisher cancelled the book in 2015.
178-
179-
I managed to get a new deal with Pragmatic. I started converting my
180-
content to their build system and rewriting the book according to the
181-
more pragmatic style of the new publisher, cutting down the content
182-
even further. The series editor also wanted me to fit the book into
183-
the Elixir series, and I tried to add more Elixir examples. I did not
184-
manage to make it into an Elixir book, and my progress was
185-
still slow, which led to another cancellation of the book in early 2017.
186-
187-
Now I had three repositories with three different book-building systems
188-
with three different outlines of the book. In the end, I more or less
189-
went back to the original longer book outline and the original AsciiDoc
190-
build system. I started a new repository in a private GitHub account and
191-
started pulling in content from the three different versions.
192-
193-
Then on April 7, 2017, I opened the repository to the public to share it with
194-
some students. I didn't think anyone else would notice, and I was not
195-
planning to release the book for real yet since the repo currently
196-
contains bits and pieces from the different versions of the book.
197-
198-
There was more interest than I had expected, though, and fortunately,
199-
also several who were willing to contribute. From now on, the book
200-
is a collaborative effort to document the Erlang runtime system, ERTS
201-
and the Erlang virtual machine BEAM,
202-
and it is released with a Creative Commons license (see above).
203-
204-
Watch this space for further news and to see the whole book take shape.
205-
206-
-- Erik Stenman aka Happi
207-
131+
*The Erlang Runtime System* by Erik Stenman is licensed under
132+
**Creative Commons Attribution 4.0 International (CC BY 4.0)**.
133+
See [LICENSE](LICENSE) for details.

cover.pdf

123 KB
Binary file not shown.

publishing/back_jacket.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
geometry: "paperwidth=6in,paperheight=9in,margin=0.6in"
3+
fontsize: 11pt
4+
pagestyle: empty
5+
mainfont: "Lato"
6+
header-includes:
7+
- \usepackage{xcolor}
8+
- \color{white}
9+
- \usepackage{graphicx}
10+
- \usepackage{eso-pic}
11+
- \AddToShipoutPictureBG{\AtPageLowerLeft{\includegraphics[width=\paperwidth,height=\paperheight]{publishing/bg_texture.jpg}}}
12+
---
13+
14+
\vspace*{1.5cm}
15+
16+
\noindent
17+
\begin{minipage}[t]{1.3in}
18+
\vspace{0pt}
19+
\includegraphics[width=1.3in]{publishing/erik_cropped.jpg}
20+
\end{minipage}
21+
\hfill
22+
\begin{minipage}[t]{2.8in}
23+
\vspace{0pt}
24+
\begingroup\small
25+
\textbf{Erik Stenman} is a software engineer, researcher, and entrepreneur with
26+
deep expertise in Erlang, BEAM, and high-performance distributed systems.
27+
As one of the early pioneers in BEAM internals, Erik has spent decades
28+
optimizing concurrent systems and designing fault-tolerant architectures.
29+
\endgroup
30+
\end{minipage}
31+
32+
\vspace{0.3cm}
33+
\noindent\textcolor{white!40}{\rule{\linewidth}{0.4pt}}
34+
\vspace{0.6cm}
35+
36+
BEAM is the heart of Erlang and Elixir, powering fault-tolerant, concurrent,
37+
and distributed systems used in finance, telecom, and messaging platforms
38+
worldwide.
39+
40+
\vspace{0.3cm}
41+
42+
This book takes you deep into the Erlang RunTime System (ERTS), revealing
43+
how the BEAM VM works under the hood. It provides the technical depth you
44+
need to master process scheduling, memory management, and bytecode execution.
45+
46+
\vspace{0.3cm}
47+
48+
- BEAM internals and bytecode execution
49+
- Process scheduling and concurrency
50+
- Memory management and garbage collection
51+
- Profiling, debugging, and tracing BEAM applications
52+
53+
\vspace{0.6cm}
54+
55+
\begingroup\small\noindent
56+
The HappiHacking Systems Series focuses on scalable architecture, runtime
57+
behavior, and ownership-driven system design in high-complexity environments.
58+
\endgroup
59+
60+
\vfill
61+
62+
\noindent
63+
\begin{minipage}[b]{2.5in}
64+
\begingroup\scriptsize
65+
Published by HappiHacking, Stockholm, Sweden\\
66+
\texttt{happihacking.com}
67+
\endgroup
68+
\end{minipage}

publishing/back_of_cover.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
geometry: "paperwidth=6in,paperheight=9in,margin=0in"
3+
pagestyle: empty
4+
header-includes:
5+
- \usepackage{graphicx}
6+
- \usepackage{eso-pic}
7+
- \AddToShipoutPictureBG{\AtPageLowerLeft{\includegraphics[width=\paperwidth,height=\paperheight]{publishing/bg_texture.jpg}}}
8+
---
9+
10+
\thispagestyle{empty}
11+
\mbox{}

publishing/bg_texture.jpg

95.7 KB
Loading

publishing/erik.jpg

222 KB
Loading

publishing/erik_cropped.jpg

602 KB
Loading

resources/book_cover.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
geometry: "paperwidth=6in,paperheight=9in,margin=0in"
3+
pagestyle: empty
4+
header-includes:
5+
- \usepackage{graphicx}
6+
- \usepackage{xcolor}
7+
- \usepackage{fontspec}
8+
- \setmainfont{Lato}
9+
- \usepackage{tikz}
10+
- \usepackage{eso-pic}
11+
- \AddToShipoutPictureBG*{\includegraphics[width=\paperwidth,height=\paperheight]{resources/redcover.jpg}}
12+
---
13+
14+
\begin{tikzpicture}[remember picture, overlay]
15+
% Title
16+
\node at ([yshift=-1.3in]current page.north)
17+
{\fontsize{40}{48}\selectfont\color{white}The};
18+
\node at ([yshift=-2.5in]current page.north)
19+
{\fontsize{72}{84}\selectfont\bfseries\color{white}BEAM};
20+
\node at ([yshift=-3.5in]current page.north)
21+
{\fontsize{52}{62}\selectfont\bfseries\color{white}Book};
22+
% Rule
23+
\draw[white, opacity=0.4, line width=0.5pt]
24+
([yshift=-4.1in, xshift=-1.5in]current page.north) --
25+
([yshift=-4.1in, xshift=1.5in]current page.north);
26+
% Subtitle
27+
\node at ([yshift=-4.7in]current page.north)
28+
{\fontsize{15}{22}\selectfont\color{white}Understanding the Erlang};
29+
\node at ([yshift=-5.05in]current page.north)
30+
{\fontsize{15}{22}\selectfont\color{white}Runtime System};
31+
% Author
32+
\node at ([yshift=1.0in]current page.south)
33+
{\fontsize{31}{36}\selectfont\bfseries\color{white}Erik Stenman};
34+
% Publisher mark
35+
\node[opacity=0.45, anchor=south east]
36+
at ([xshift=-0.4in, yshift=0.3in]current page.south east)
37+
{\includegraphics[height=0.5in]{resources/hh_publisher_mark.png}};
38+
\end{tikzpicture}

0 commit comments

Comments
 (0)