8 ms·
Writing your own BEAM
- macintux 10mo agoNow I'm curious whether Joe Armstrong's original Prolog implementation of the VM is available anywhere, but I doubt it.
- rramadass 10mo agoThe next best thing : Implementing a Functional Language for Highly Parallel Real Time Applications by J.L.Armstrong et al. (pdf) - https://www.cs.tufts.edu/~nr/cs257/archive/joe-armstrong/erlang-jam.pdf https://www.cs.tufts.edu/~nr/cs257/archive/joe-armstrong/erl... Seems like this is the design behind the original JAM VM. The "References" section cites more early work. See also The Erlang BEAM Virtual Machine Specification by the OG Bogumil Hausman himself ! Note: This document describes BEAM as it was in 1997. BEAM has grown and changed significantly between then and the time this note was added (2012). This information is mainly for historical interest. - https://www.cs-lab.org/historical_beam_instruction_set.html https://www.cs-lab.org/historical_beam_instruction_set.html Together, they should provide a lot of insights into ERTS/BEAM.
- lukego 10mo agoJoe used to have all that code in his world-readable NFS-mounted home directory. He would just create a new directory for every idea or project. Take it with him from one computer to the next. I hope that's preserved and one day published as e.g. the old MIT AI lab file system snapshots were. (Robert Virding or Bjärne Däcker might well have a copy of the Prolog code to share if asked nicely.)
- efitz 10mo ago[flagged]
- giancarlostoro 10mo agoI think its written for people who already know what the BEAM is. The BEAM is the VM for Erlang or Elixir, similar to how Java has the JVM and C# has .NET essentially.
- jedmeyers 10mo ago[flagged]
- MeetingsBrowser 10mo agoI think there are plenty of context clues in the first few sentences. > ... fascinated with BEAM, how it allowed easy spawning of processes ... > ... the appeal of BEAM languages ... > ... haven’t read The BEAM Book yet ... > ... examples are written in Elm ...
- ohyoutravel 10mo agoIt’s poor writing.
- jedmeyers 10mo ago[flagged]
- Jtsummers 10mo agoWho would look at something called The BEAM Book with a link to [1] and think that it refers to a book with a completely different title? [1] https://blog.stenmans.org/theBeamBook/ https://blog.stenmans.org/theBeamBook/
- jedmeyers 10mo agoBecause of you ask a person who works on Beam about “the Beam book” thats the one they are going to recommend. Who knows that the BEAM book is literally called “the BEAM Book”? There are many books like that, “the SRE book” is actually Site Reliability Engineering: How Google Runs Production Systems, etc.
- joshuaissac 10mo agoThe VM used for Erlang and Elixir.
- Alupis 10mo ago...and Gleam.
- sbuttgereit 10mo ago...and LFE and Luerl and probably others that I'm forgetting.
- macintux 10mo agoI have an older list, but I don’t know how many of the links are still valid. https://gist.github.com/macintux/6349828#alternative-languages-targeting-the-erlang-vm https://gist.github.com/macintux/6349828#alternative-languag...
- MeetingsBrowser 10mo ago> This is my Code BEAM Europe 2025 talk, converted to a blogpost. The blog is a text version of the talk, not an invitation to watch the talk.
- depr 10mo agoWhen can we be done with these cheap comments? It has really become tiring to have a comment tree on every HN post for people who don't know what the article is about. As the author often didn't submit their own article it is just a complaint with no possible resolution. Instead of taking a few seconds to find out what the article is about and maybe even clarifying it for your fellow readers, you are taking that time to write a comment that only detracts from a possible conversation. If you can't bring yourself to search for 5 seconds and find out what an article is about, maybe you just close it and move on.
- zenlot 10mo ago[dead]
- observationist 10mo ago> I was always fascinated with BEAM (Bogdan Erlang Abstract Machine, a VM for languages like Erlang and Gleam) and how it allowed easy spawning of processes that didn’t share state, allowed for sending and selectively receiving messages, and linking to each other thus enabling creation of supervision trees. That's all it takes. When you're writing about a niche topic (and nearly everything and anything interesting is a niche topic) then explain your jargon. It's considerate, reminds people who are familiar but might have forgotten, and introduces people unfamiliar with it to what your topic is. Sometimes people want to understand what they're reading about and not have to play a little "guess what this is about" game. Clarity is a quality of good writing.
- arthurcolle 10mo agohttps://en.wikipedia.org/wiki/BEAM_(Erlang_virtual_machine) https://en.wikipedia.org/wiki/BEAM_(Erlang_virtual_machine)
- calmworm 10mo agoI feel like this is just an opportunity to either learn what it is or move on. That’s essentially what hn and “hacking” is, isn’t it? This post caught my eye because I was learning about BEAM just last week for the first time.
- FredPret 10mo agoI have learnt to love and embrace the BEAM. Wikipedia says "Originally BEAM was short for Bogdan's Erlang Abstract Machine, named after Bogumil "Bogdan" Hausman, who wrote the original version, but the name may also be referred to as Björn's Erlang Abstract Machine, after Björn Gustavsson, who wrote and maintains the current version." Whether the B is for Bogdan or Bjorn, there's something really fun and Space Quest-y about it.
- DrewADesign 10mo agoI like to think the B stands for BEAM.
- yas_hmaheshwari 10mo agoSame here! I also don't want "the facts to come in the way of a good story", and want to believe B is BEAM.
- DrewADesign 10mo agoSounds like it’s time for your nap.
- IshKebab 10mo agoVery cliché.
- DrewADesign 10mo agoHey it’s a classic for a reason.
- IshKebab 10mo agoBecause people are unoriginal.
- DrewADesign 10mo ago
- Alupis 10mo agoThe BEAM is fascinating for many reasons, including being register-based. I really just wish the BEAM was portable in the way the JVM is. The BEAM hooks into so many system libraries, you must compile it on every flavor of linux instead of just unpacking a tarball. This means you either must use your distro package manager's version, or compile from scratch. If you want to control the exact version that's being used across your team (via `asdf` or similar), this practically means you'll end up compiling the BEAM over and over...
- hamandcheese 10mo agoPerhaps you should give Nix a try :)
- Alupis 10mo agoCorrect me if I'm wrong, but you'd still have to compile it from source on nix, no? On my relatively powerful workstation, Erlang/BEAM takes about 7 minutes to compile. We're working around this currently by having a fat devcontainer image, pre-built with Erlang inside (from source) by our CI. It chews through CI minutes unavoidably due to how docker layer caching works. It would be awesome to just download and unpack a tarball, regardless of which distro you're using.
- Cyph0n 10mo agoNix is centered around the local Nix store and binary caching. As long as the specific version of Erlang you’re using is present in either your Nix store or the global cache for your OS and arch (at cache.nixos.org), you should not need to compile anything. And if you rely on custom builds, you can just setup your own binary cache. This is similar to remote caching in Bazel. Some more details on Nix caching here: https://zero-to-nix.com/concepts/caching/ https://zero-to-nix.com/concepts/caching/
- hamandcheese 10mo agoWe do exactly this at my dayjob - we have (multiple) very specific combinations of (erlang, elixir, hex, rebar3) that we use which are pinned to exactly the versions we need. We have a private Nix cache so we only have to build them once. https://www.cachix.org/ https://www.cachix.org/ simplifies running a custom cache. Well worth the money, IMO. That said, learning nix and setting up a nix cache is still a lot of work. Docker buildx might offer you some more knobs to cache portions of your build in a finer-grained manner without having to take the nix plunge.
- rramadass 10mo agoNice. Have to spend some time reading it but i really like the minimalistic and clean design of your site content. No unnecessary colors/asides/verbiage/etc. nonsense but THE content and only the content presented directly. A suggestion: Please add a "Overview" section in the beginning to provide the big-picture architecture since without that it would be hard to understand your code. PS: In case you didn't see it, my comment here mentions some documents that you might find useful for your implementation - https://news.ycombinator.com/item?id=45883694 https://news.ycombinator.com/item?id=45883694
- sublimefire 10mo agoDid not know about it much before but apparently was doing something similar (in spirit) when experimenting with simple task execution queues in go. This is quite interesting and given that hot code reloading is a thing in beam it might be something to explore further.
- malkosta 10mo agoBeautiful! :clap:
- shreddit 10mo agoClicked on the link because I don’t know what a “BEAM” is, was not disappointed