
Ask HN: What is the state-of-the-art environment for developing Erlang code? - arnon
I was big into Erlang in 2014, but haven&#x27;t touched it since. I used to write code in Emacs and compile it there as well.<p>If I want to get started again (on either Windows or Ubuntu) what would be the base I&#x27;d need to get developing again?
======
sntran
Contrary to others here, I would still suggest to stick with Erlang, but use
Elixir's toolkit.

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.

~~~
gglitch
Interesting. Can you suggest an example repo built this way?

~~~
sntran
Not a very good example in term of usefulness and completeness, but I did one:
[https://github.com/sntran/gen_spider](https://github.com/sntran/gen_spider)

------
michael_j_ward
An aside, after you've learned a few langugages- the biggest friction to
learning a new one is learning the tooling and dev environment for that
language.

If someone is looking for an side-project idea, something like "Show me your
dev workflow / environment" could make for a valuable resource.

~~~
faitswulff
Sounds like HowIStart: [https://howistart.org/](https://howistart.org/)

Github repo here:
[https://github.com/howistart/howistart.org](https://github.com/howistart/howistart.org)

~~~
leetrout
The Go example is getting pretty dated... I wonder if Peter would do a
rewrite?

------
namelosw
I'm afraid there are no big changes, there's an IntelliJ plugin but it's not
as slick as Emacs. If you are already comfortable with Emacs it's all good.

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

------
aloukissas
We use Elixir/Phoenix for our entire backend here at AgentRisk and we're all
on vscode (works great). Previously the team was a big erlang shop (BugSense)
but we'll go with Elixir any given day.

~~~
jasonlotito
What plugins do you recommend for vscode?

------
ashton314
I've been writing a lot of Elixir recently, and I'm very impressed with the
Emacs' language server support:

[https://github.com/emacs-lsp/lsp-mode](https://github.com/emacs-lsp/lsp-mode)

Looks like Erlang is one of the supported languages, so I'd give that a whirl.

------
dayjah
I’m currently on a project which uses Elixir and the Phoenix framework. Both
are pretty good.

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.

~~~
rehemiau
mix is a part of Elixir, not a part of hex.

------
metroholografix
Emacs, erlang.el (comes with Erlang) and distel.

------
codyb
I just use ViM and it’s fine for me. I’ve got autocomplete, syntax
highlighting, and ripgrep for file searching. I think I can jump from a
function to it’s definition but I’d have to double check.

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.

------
cpursley
Elixir, seriously: [https://elixir-lang.org/install.html](https://elixir-
lang.org/install.html)

~~~
arnon
What would be the reasons I'd want to use Elixir over Erlang?

~~~
ddragon
The greatest feature of Elixir in my opinion (and it's a beautiful language
with a lot of great features in the first place, including the advantages of
the Erlang VM and Library) is the care it got in being approachable and easy
to use. It has some of the best documentation I've seen extended to pretty
much all environment surrounding the base language (including the integration
with OTP for parallel processing), Phoenix and Ecto, plus great books and a
very friendly community. The design of all those components is also very well
done to avoid surprises for people coming from "modern" languages and to avoid
unnecessary complexity. And it also has a nice plugin and formatter for
vscode.

~~~
pdmd_api
Yes, documentation and just the syntax (to me at least) seems a hell of a lot
simpler than erlang. You can always use erlang libraries in Elixir as well.

~~~
davidw
Erlang's syntax is not difficult or complex; it's just 'different' from what
people are used to.

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.

~~~
PopeDotNinja
> Erlang's syntax is not difficult or complex

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.

------
pdmd_api
For someone who has been learning Elixir off and on the past year or so, it
can work on Windows but it's a lot easier to use the command line tooling with
WSL. Given all the Remote tooling VS Code just released, these days I just use
that to SSH into an EC2 box and use that as my dev environment.

------
srik
If you’re looking for something new from the same foundation, checkout the
elixir ecosystem.

~~~
throwaway8879
What's the deployment story on Elixir as of now? I recall that some previous
threads had not-so-nice things to say about deploying Elixir apps. Any
progress on this front?

~~~
dnautics
It got pretty good literally 4 or so months ago with 1.9 I wrote a module that
deploys to an (existing aws) instance in about 15 minutes. If I wanted to have
it provision an instance too that probably would have taken me only a bit more
time (using the exaws module). Containers are easy too (but I only did a one-
off in singularity, don't know about docker). Releases are "in language" so
I'm basically writing a dynamic elixir script that calls system (Unix) tools
as if it were an elixir script, no shell script at all.

------
rapsey
If actual erlang then VSCode. There is a nice language server plugin
(pgourlain.erlang) for it.

cowboy if you need a web server.

rebar3 for package management and build.

------
Nextgrid
IntelliJ IDEA has plugins for Erlang support and as a beginner with the
language it’s been more than enough. Not sure if there are any issues that
would be blockers for more advanced users though.

------
dotdi
I recently started working with Erlang and Elixir at my current company and
I'm doing everything with VSCode.

We have Erlang/rebar3, Erlang/mix and Elixir/mix projects, and no issues
whatsoever with VSCode.

------
iLemming
I've never used Erlang professionally, I'm a Clojure person, but I know that
Emacs has a superb support for Erlang. Late Joe Armstrong himself was a well-
known Emacsen.

------
rooam-dev
As a long time Eclipse user, Erlide has been working fine for me (1 week into
learning Erlang). Autocompletion (both editor and shell) is helpful.

------
_zachs
Don't develop on Windows but I hear their new WSL2 lets you have a pretty
well-working Linux environment.

