What is the difference between rebar and rebar3? or erlang.mk
Asked Answered
H

1

16

I am very new to Erlang programming language. Is there a standard build tool in Erlang?

I have googled out these, not sure which one I should use. I don't know that what kind of occasion is it used for?

Hepler answered 21/1, 2016 at 2:51 Comment(0)
B
14
  • Rebar2: It is first usable and de facto build tool that most of the Erlang projects are using it. It uses Erlang script for getting dependencies, compiling, testing and making release of your project. However it is not a modern build tool and suffers from slowness of compiling in developing phase, difficulty for using in larger projects and a bit hard to understand for newcomers.

  • Rebar3: It is a successor to rebar2 with an attempt to improving its mechanism and providing new features which is compatible with modern build tools. Also it is easier to use for newcomers

  • Erlang.mk: It is a big Makefile. As Makefile is fast and is available by default in every unix system, so you can benefit from these features for your Erlang application build tool. It has a package index of most well-known Erlang projects and other standard features like Rebar. Also it is faster that rebar2 in developing phase (preliminary results show that rebar3 is notably faster than Erlang.mk)


I myself use Rebar and this possible duplicate of your question has two answers that recommend Rebar as well. But it is a matter of taste and I recommend to consider two different approaches and choose what is closer to your purposes.

Birk answered 21/1, 2016 at 8:28 Comment(3)
One advantage of Rebar is that it is compliant with the OTP (I do not say that Erlang.mk is not, I don't use it!) so by using it you get used to the OTP file organization (easy to share application, or look into an existing one) and all the tools are ready to use (test, monitoring...).Bailiff
There was some numbers posted on one of the Erlang IRC channels of rebar2, rebar3 and erlang.mk build times. Rebar2 was the slowest by far. But rebar3 was substantially faster than Erlang.mk on first build and even more so on second build because it caches a lot of info make has to regather every run.Lorenelorens
rebar3 has partial compile so it is very fast for development as it does not recompile your entire project. Also rebar3 has a plugin that will auto compile and load files that change on disk, leading to a remarkable development experience. Having used rebar2, rebar3 and mix (for elixir), I find rebar3 saves me a ton of time and is fully OTP aware + compliant.Madlynmadman

© 2022 - 2024 — McMap. All rights reserved.