Why I wrote the BEAM book (2025)

(happihacking.com)

163 points | by zenincognito 2 days ago

12 comments

  • dimamik 21 minutes ago
    I've been building with Elixir for the last 5 years, and comparing to Python or NodeJS - it's a breath of fresh air. Such decent developer experience, so easy to understand how your system works because of actors and well-defined primitives. If you haven't - you definitely should give it a try!

    In an AI era I feel like the tiny amount of Elixir code in comparison with other languages, but all that code having higher signal to noise ration vastly contributed to how good LLM-written Elixir code is. Especially in a well-maintainted codebase that relies on a decent db schema and Oban.

    • fridder 12 minutes ago
      I think the new typing system will also help immensely. LLMs do like their nice clear error messages
  • neya 13 hours ago
    Oh wow, I never knew Klarna uses BEAM. I always thought BEAM is vastly underrated and it's even hard for me to convince clients of showing how powerful it (Elixir/BEAM) really is, especially when they're already on something like NodeJS. This will be a nice reference to use in conversations with future prospects.
    • vmg12 3 hours ago
      To add on to your statement that the BEAM is vastly underrated, it's the only runtime that I know of that has enabled multiple small sub 50 people teams to scale to millions of daily active users.
    • jurgemaister 6 hours ago
      One of the early investors worked for Ericsson on Erlang.
    • troupo 4 hours ago
      Klarna was one of the biggest Erlang shops in 2010s. Then there was some turmoil, but their main system is still in Erlang
    • worthless-trash 9 hours ago
      I'm interested to see how this goes, I find it difficult to convince anyone to change from the herp-derp status quo.
  • pjm331 1 hour ago
    just picked up a copy

    I'd been looking for an excuse to build something in Elixir pretty much since the language was released, and in just the past year and a half I've had the good fortune of getting to use it to build an in house AI agent orchestration system and it's been an absolute pleasure

  • oivaksef 9 hours ago
    There will be winners in this new AI age, and they will be the ones that are technically better, rather than the most popular or convenient for software engineers
    • thibaut_barrere 8 hours ago
      I use Elixir (BEAM-based), with LLMs daily, on a fast growing site (current pace is 5 billion HTTP queries per year on a single front node).

      Elixir is well handled by LLMs at this point, and we keep the “easy to scale and maintain” aspect (operational characteristics of the runtime are very good).

      I can safely say that total cost of ownership is excellent.

      • valzam 8 hours ago
        I think that's the first time I see someone use qpy...
        • thibaut_barrere 7 hours ago
          Fair enough! That’s how we track growth, it’s easier to communicate to state sponsors.

          Roughly 14M per day, but growing 2.5 to 3 on a YoY basis.

          My point stands though: much more serenity in ops with that growth, and LLMs do work nicely, especially when most of the code is stateless by language design.

          • Zanfa 6 hours ago
            The important metrics is peak requests per second. 14M / day sounds impressive, but it’s only a sustained 160 per second which literally any language and framework can handle on the lowest end hardware.
            • thibaut_barrere 6 hours ago
              Sure, peaks are much higher. But a good part of it is reverse proxying with in-memory caching and locking, which I've implemented in several stacks over the years, and many struggle with it (I have been paid to do comprehensive benchmarks on the topic). On the BEAM it's a non-event.
            • kryptiskt 3 hours ago
              Only if users are nice and spread the load evenly over the day, but they are never so considerate.
              • Zanfa 2 hours ago
                Sure, that's why I highlighted peaks as a more important metric than average. Even an order of magnitude higher peaks over the average is still fairly trivial, compared to where BEAM shines. Maintaining hundreds of thousands of concurrent long-lived connections per server is what it excels at, but also not something that's relevant to 99% of web apps out there.
          • shakna 6 hours ago
            Being generous... That's about 10k/s? So you're just in range of the C10k problem that OTP was built to overcome?
            • whizzter 3 hours ago
              To be fair, Erlang runtime semantics (cooperative "async threads") never needed changing to tackle C10k problem, they got that right as part of the early designs before C10k was even on the tasble.

              Everyone else just moved towards the same kind of cooperative thread runtime semantics (even if the lingo differs, async in C#, callbacks first, then async in NodeJS, virtual threads in Java, async in C++ and so on).

              I think an interesting historical tidbit is that Java actually had M:N threading in early versions (1.1, 1.2, 1.3?) that got ripped out because it was deemed complex and error-prone since people back then often did native bindings naively (And perhaps file/socket API's were less complete?) only for them to reintroduce it again in Java 20 I think it was under the virtual threads name?

            • thibaut_barrere 6 hours ago
              ~160 req/s on average, higher peaks. Not trying to impress anyone though, my point was that LLMs work perfectly fine on an Elixir codebase, and that we get future-proof ops on a single node with zero issues. In my experience, it has been easier than with any other stack I've tried.
    • pjmlp 5 hours ago
      All 3GL languages are looser in the AI age, beyond formal verification tooling.

      I have done several experiments where, the only difference are a couple of paragraphs describing the technology stack for the AI tools.

      Hardly any different than changing the target CPU architecture on a compiler output.

      Quite sad, as now the fun of why language X instead of Y is gone.

      • aeonfox 5 hours ago
        > I have done several experiments where, the only difference are a couple of paragraphs describing the technology stack for the AI tools.

        The differences emerge as the project goes on. Comparing feature velocity and defect count is difficult unless your experiment is to build the same project over a long timeframe across several languages. Then winners would indeed emerge, but then that's only in the context of whatever domain said project is tackling. For instance, if concurrency or infrastructure isn't a large part of the complexity, BEAM languages might not confer much benefit.

        • dnautics 2 hours ago
          > BEAM languages might not confer much benefit.

          Immutable value languages like BEAM langs are probably useful too, the LLM doesn't have to guess whether a value passed into a function will get mangled by the callee

    • te_chris 7 hours ago
      Elixir is perfect for the ai age as it allows you to move a lot of orchestration safely into the application layer.
  • marcle 2 hours ago
    Life in Sweden is a series of moments between fika:)
  • ValtteriL 8 hours ago
    I love Erlang, Elixir, and BEAM by extension. Lucky to have been forced to learn it at KTH.
  • sharts 7 hours ago
    Perhaps github should read it
    • Arubis 48 minutes ago
      Why? Historically they're mostly a Ruby shop.
  • bpbp-mango 5 hours ago
    thank you. I've not had time to learn Erlang but always been intrigued by beamp + otp. now with llms I might have a chance to see what's possible
  • bradknowles 1 day ago
    [flagged]
  • minfazhai 13 hours ago
    [flagged]
  • relativeadv 2 hours ago
    Did he write the book? Because he didn't write this post.