Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What is the state-of-the-art environment for developing Erlang code?
76 points by arnon on Aug 8, 2019 | hide | past | favorite | 37 comments
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?




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.


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


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


I cannot show you any code but only tell you that our Erlang team is currently migrating all Erlang projects from rebar to mix and the rest of the Elixir tooling exactly for those reasons.


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.


Sounds like HowIStart: https://howistart.org/

Github repo here: https://github.com/howistart/howistart.org


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


And to answer the OP's question: https://howistart.org/posts/erlang/1/


That, plus how to debug package management issues. I've been bitten by package management issues so much that I always want to know how a language's package management works under the hood because I no longer trust that layer of abstraction to actually hold.


To be fair this is true about a lot of software. IMO most nontrivial CLI tools and libraries benefit from a "data model" doc.


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.


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.


What plugins do you recommend for vscode?


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

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


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.


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


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


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.



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


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.


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.


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.


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


From a language point of view, the main difference is that Elixir has macros. Used judiciously they are a good tool for abstraction and can provide some nice APIs.

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.


Huge plus!


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.


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


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?


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.


There's Distillery for releases, but since Elixir 1.9 releases are part of the language.


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.


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.


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.


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.


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.


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




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

Search: