Erlang now in Compiler Explorer

As of a few days ago, the Compiler Explorer has started supporting Erlang. You can choose the Erlang language from the dropdown menu above the left-side editor panel, enter code into the editor, and assuming it’s correct the compiler will show you the generated code in the right-side panel or will show you errors if not. Compiler Explorer supports lots of languages, and is really handy for experimenting with language snippets and sharing code examples or bug examples with others via its Share button, so it’s nice to see Erlang now supported there too.

The Compiler Explorer git log shows that Timothy Moores and Patrick Quist contributed this, so hats off to them!

–steve

14 Likes

So long, erlc -S!

4 Likes

I have found the Compiler Explorer to be very useful when implementing instructions for the JIT.

Nice that it is now available for Erlang. I think that it will come in handy when I want to see the BEAM code for older versions of Erlang/OTP that I currently don’t have installed on my computer.

Unfortunately, the formatting of the BEAM code by Compiler Explorer is not as nice as the output of erlc -S. So I submitted a pull request:

5 Likes

May I plug my “erlang compiler explorer” here?

URL: http://tryerl.seriyps.ru/
Github: GitHub - seriyps/eplaypen: Erlang web playground http://tryerl.seriyps.ru/

It actually supports much more versions of OTP and can show much more compiler stages intermediate formats:

The interface is not as nice though =)

7 Likes

I seen this tool before. Amazing work! I think, it’s would be great to have a separate topic with description, motivation etc.

2 Likes

Yeah… I was planning to do a post, but never had time to actually do that.
Also was thinking about some kind of proposal to integrate it with erlang.org, but again, I did mostof active work on it years ago, so, now only add new OTP versions from time to time.

4 Likes

Actually this is also a good idea. I believe that this can be done pretty simple:
In GitHub - erlang/erlang-org: The erlang.org website find place where the menu is placed and add button eg. try Erlang, when user will click in this button - will be show popup where user will be able to try it in <iframe />. It might be worth talking @garazdawi about it, because he did a great bootstrap integration into documentation site and continue actively working on improvements etc. Or at least open a ticket to the erlang-org with a proposal. But of course up to you :upside_down_face:.

3 Likes

You should consider crafting a pull request to add this to Compiler Explorer. The Compiler Explorer code is pretty easy to work with.

–steve

3 Likes