[erlang-questions] Any Erlang Devs Contemplating Elixir?
Mon Feb 29 02:18:21 CET 2016
Sorry I've not been able to get back to you sooner, Loïc. As I said, I got
that impression from people I know who are working with production Erlang
systems--and I don't believe I misunderstood them on that point. Maybe
they need to learn a bit more about Erlang too.
On Sat, Feb 27, 2016 at 5:54 AM, Loïc Hoguin <> wrote:
> On 02/26/2016 10:27 PM, Onorio Catenacci wrote:
>> While there may be other considerations you want to keep in mind,
>> there's one, to my mind, major point that's been neglected in the
>> discussion of using Elixir: macros.
>> I have been led to understand by people far more familiar with Erlang
>> than I am that in order to use certain behaviours from OTP one has to
>> write boilerplate code for several callbacks whether one wants to modify
>> the behavior from defaults or not.
>> Elixir's macros allow the library to provide default implementations for
>> these callback functions. Of course a developer can override the
>> defaults if needed but not having to code what I don't need strikes me
>> as a big advantage--especially if we're discussing a new developer who
>> doesn't already know either Erlang or Elixir.
> I'm not even sure what makes you think you need macros to provide default
> implementations? You don't. The gen_server for example has an optional
> callback with a default implementation: format_error. That it doesn't
> provide defaults for other callbacks is purely a design choice, and not a
> limitation of the language. You could trivially extend gen_server to make
> all callbacks optional, no need to have macros for that...
> Loïc Hoguin
> Author of The Erlanger Playbook,
> A book about software development using Erlang
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions