5 ms·
A Peek Inside the Erlang Compiler (2012)
- ramchip 6y agoTwo 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/
- hkgumbs 6y agoA 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.html https://8thlight.com/blog/kofi-gumbs/2017/05/02/core-erlang.... [1]: https://github.com/hkgumbs/codec-beam https://github.com/hkgumbs/codec-beam
- macintux 6y agoNice. I added your codec-beam project to my Erlang resources gist: https://gist.github.com/macintux/6349828 https://gist.github.com/macintux/6349828
- h91wka 6y agoNeat! But please bear in mind that BEAM VM trusts the bytecode, so if your compiler emits buggy bytecode, it can crash the entire VM.
- lowmemcpu 6y agoI'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?
- square_usual 6y agoThere's no shortage of jobs looking for elixir developers, which is based on erlang.
- davidw 6y agoAs 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.
- h91wka 6y agoI passed a couple Elixir interviews with zero knowledge of this language :) You can just treat it as Erlang with funny syntax.
- davidw 6y agoThere 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 https://ferd.ca/ten-years-of-erlang.html
- rkangel 6y agoAny 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.
- marianoguerra 6y agoIf 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=bd6dd1067bbae20b15f76cbe44919cc6e579b76d+34 https://github.com/marianoguerra/otl/commits/master?after=bd... slides from a presentation I gave: http://marianoguerra.org/talks/beamba-buenos-aires-meetup/#/how-beams-are-made http://marianoguerra.org/talks/beamba-buenos-aires-meetup/#/...
- jtolmar 6y agodadgum'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.