Re:Which companies are using Erlang, and why?
by superhawk610 on Monday September 30, 2019 @02:44AM
(#21112334)
Not OP, but have used Elixir pretty extensively; the major selling points for me are the friendlier syntax and more active community support, plus with rebar3 + Elixir's seamless Erlang interop you really don't give up anything, you can use any existing Erlang/Elixir libraries with a single syntax. It's pretty great.
[ Parent
| on HN ]
Re:Which companies are using Erlang, and why?
by alskdj21 on Monday September 30, 2019 @02:50AM
(#21112362)
Haven't touched Erlang but has an entry level knowledge on Elixir. I often heard how easy it is to write macros on Elixir. Can you elaborate on this?
Re:Which companies are using Erlang, and why?
by arjan_sch on Monday September 30, 2019 @04:06AM
(#21112763)
One of the big differences between Erlang and Elixir is indeed that Elixir allows you to write macros in the language itself, using quote / unquote constructs just like lisps.
This makes it easy to generate code on compile time, which is then executed in runtime without any performance penalty.
A large part of Elixir itself is actually implemented as macros. For instance, the "unless" construct:
defmacro unless(condition, do: do_clause, else: else_clause) do
quote do
if(unquote(condition), do: unquote(else_clause), else: unquote(do_clause))
end
end
(code simplified for clarity)
Re:Which companies are using Erlang, and why?
by fcbrooklyn on Monday September 30, 2019 @11:46AM
(#21116626)
And the if-else construct is also a macro. The whole thing ends up being a case I think.