Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Peek Inside the Erlang Compiler (2012) (dadgum.com)
72 points by Tomte on June 9, 2020 | hide | past | favorite | 15 comments


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....

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


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.


Nice. I added your codec-beam project to my Erlang resources gist: https://gist.github.com/macintux/6349828


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/


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...

slides from a presentation I gave: http://marianoguerra.org/talks/beamba-buenos-aires-meetup/#/...


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?


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)


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.


There's no shortage of jobs looking for elixir developers, which is based on erlang.


As sort of an aside, that can be an interesting lens to view hiring through. A while back I was looking around, and since I have some history with Erlang, was looking for roles involving Erlang and Elixir, among other things. I've architected and written production Erlang code that's deployed in products and know the system fairly well. But I don't have a lot of Elixir experience.

Some companies were like "wow, that's a lot of BEAM experience - let's talk!".

Others were like "my checkbox says Elixir, sorry".

I'm old enough at this point to realize the latter were doing me a big favor.


I passed a couple Elixir interviews with zero knowledge of this language :) You can just treat it as Erlang with funny syntax.


Any sensible employer should treat Erlang and Elixir experience as equivalent. There are important differences, but it would only take 2 weeks for someone experienced with one to be pretty up to speed with the other.

It is, for instance, the opposite situation to C and C++. In that case, they are languages that share syntax but you should code in fundamentally different ways. Erlang and Elixir don't share syntax, but all the important core concepts are the same.


There are a few more substantial differences, like Elixir utiling binaries rather than Erlang's 'strings' that I think are nice improvements, but I was never worried about getting up to speed with Elixir. The tricky bits of working with BEAM are nicely illustrated here:

https://ferd.ca/ten-years-of-erlang.html


There is employment channel here: https://erlanger.slack.com/


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: