
A Peek Inside the Erlang Compiler (2012) - Tomte
https://prog21.dadgum.com/127.html
======
hkgumbs
A few years ago, I tried to use Core Erlang as a compiler backend. It's fairly
straightforward to learn even without thorough documentation. I wrote a bit
about my process to try to help the next person [0]. For my particular
project, I ended up abbandoning the approach and generating BEAM bytecode
instead [1]. That was definitely more challenging, but it was neat to see
Erlang's commitment to backwards compatibility in action. I believe that BEAM
modules emitted by the first versions of Erlang are still valid on modern
implementations. New functions are added and old ones are deprecated, but the
actual file format version indicator hasn't changed.

[0]: [https://8thlight.com/blog/kofi-gumbs/2017/05/02/core-
erlang....](https://8thlight.com/blog/kofi-gumbs/2017/05/02/core-erlang.html)

[1]: [https://github.com/hkgumbs/codec-beam](https://github.com/hkgumbs/codec-
beam)

~~~
h91wka
Neat! But please bear in mind that BEAM VM trusts the bytecode, so if your
compiler emits buggy bytecode, it can crash the entire VM.

------
ramchip
Two years ago a new SSA representation was added. There’s a series of posts on
the official blog that explain it well:

[http://blog.erlang.org/introducing-ssa/](http://blog.erlang.org/introducing-
ssa/)

------
marianoguerra
If you are interested follow the commits here from oldest to newest to build a
language o the beam:
[https://github.com/marianoguerra/otl/commits/master?after=bd...](https://github.com/marianoguerra/otl/commits/master?after=bd6dd1067bbae20b15f76cbe44919cc6e579b76d+34)

slides from a presentation I gave: [http://marianoguerra.org/talks/beamba-
buenos-aires-meetup/#/...](http://marianoguerra.org/talks/beamba-buenos-aires-
meetup/#/how-beams-are-made)

------
lowmemcpu
I've been interested in learning Erlang, but haven't seen more than one or two
jobs that hired for it. I'm probably looking in the wrong fields (back end) or
locations.

Could someone point me? Is there a certain industry that has more predominant
Erlang jobs?

~~~
cmrdporcupine
Likewise; I've been dancing around Erlang playing with it on and off for about
twenty years, but I'm at the stage in my life where to really dive into it I'd
have to have a job where someone paid me to work in it (or Elixir, or both).
It seems most jobs that want Erlang want specifically someone who has already
been working in it, which is a bit of a specific thing, and a bit of a
circular situation.

Similar thing for Rust, which I'd also really be into working with
professionally as well, but won't be able to where I work right now.

(FWIW I'm a mature software engineer with experience across the stack, systems
and app-level C++ mainly lately, but Java, Scala, Python prior to that.
Deployed RabbitMQ at a startup many moons ago, but that's it for direct Erlang
professionally)

~~~
ipnon
It doesn't have the entrepreneur approval yet. Elixir is halfway between toy
and legit and moving towards legit. I think we will be singing a different
tune in a decade. It's hard to imagine the distributed systems status quo
persisting so long. Software ideas have shorter lifespans.

------
jtolmar
dadgum's blog is really good, would recommend poking around other articles if
you haven't seen it.

Also, if the author is reading, my mom still talks about how she wants to play
Bumbler Bee on modern computers.

