Ask HN: What is the state-of-the-art environment for developing Erlang code?
I was big into Erlang in 2014, but haven't touched it since. I used to write code in Emacs and compile it there as well.
If I want to get started again (on either Windows or Ubuntu) what would be the base I'd need to get developing again?
37 comments
[ 5.1 ms ] story [ 102 ms ] threadVSCode is also another popular choice.
You probably want to check out Elixir as they can cross-compile, the Elixir build tool and language server are slightly better.
I haven't tried on Windows but I guess Ubuntu would be a safe bet since it's a POSIX system.
It uses “hex” for package management, which has a tool called `mix` to call build related commands.
Last I was in erlang was 2008; and I’m quite impressed with where it’s at now in terms of the above.
I’ve found the vscode elixir/erlang defaults to also be quite helpful.
I will add though, that Elixir does add some nice things besides just a more familiar syntax. Things like their string implementation stand out as a real improvement.
I will say a lot of it does feel dated & crusty though, especially when digging thru the documentation. And the different forms of iodata, list, binaries, bitstrings, and other string-y things is super confusing in the beginning.
As other people have said, there are no big new ideas in Elixir, it's just a well executed design in all the details. It also has the advantage of the tooling having been built from the ground up to current state of the art. As such, it is lovely to use.
The standard library benefits similarly. For example the '|>' operator in Elixir benefits from the fact that the standard library has a consistent argument order.
You can use `mix`, `exunit`, release, etc... from Elixir, and they can handle your Erlang codes fine. You also have better integration with editors like VSCode.
The reason for sticking with Erlang is that your project can be used in both Erlang and Elixir community. But if you write pure Elixir, it's pretty hard to use it in Erlang.
You can also write Elixir macro to wrap your Erlang code in an API. Not the other way around.
Project structure between Erlang and Elixir is similar anyway, so it should not be too difficult to have one single project for both Erlang and Elixir code.
cowboy if you need a web server.
rebar3 for package management and build.
If someone is looking for an side-project idea, something like "Show me your dev workflow / environment" could make for a valuable resource.
Github repo here: https://github.com/howistart/howistart.org
With Tmux I just keep another window open with a few terminals running my server and front end watchers.
Erlang is neat because with Cowboy and rusty/sync (I _think_ that’s the library) I get hot code reloading for server side issues. Then webpack and a simple bash script handle updates to front end assets and transferring the files to the directory Nginx is pointed to.
I try to keep my dev and production environments as close as possible to avoid unexpected surprises so I’ve used DnsMasq to set up local ssl certs.
All in all it’s one of the more pleasurable dev environments I’ve worked in. Not having to restart the server every time I make a change is a huge boon, and having my supervisors restart their children automatically on crashes is tremendous.
I’d go with whatever you’re most comfortable with for best results. Learning new environments often sucks and you may end up discouraged and spending more time learning new shortcuts and how to do X, Y, and Z unrelated to actual Erlang development which can be both discouraging and a time sink.
https://github.com/emacs-lsp/lsp-mode
Looks like Erlang is one of the supported languages, so I'd give that a whirl.
We have Erlang/rebar3, Erlang/mix and Elixir/mix projects, and no issues whatsoever with VSCode.