4 ms·
It's 100% the syntax. It appeals to ruby devs and also I think it's a lot easier to grok in general. But you can write Erlang code directly in an Elixir file, y
by schneidmaster 7y ago
It's 100% the syntax. It appeals to ruby devs and also I think it's a lot easier to grok in general. But you can write Erlang code directly in an Elixir file, you can use Erlang libraries directly in Elixir, and Elixir compiles to the same BEAM instructions that Erlang does, so there's functionally no difference in terms of capabilities or what happens when they run.
- qaq 7y agowell better unicode support too
- SteveGregory 7y agoThis is not totally true. It’s not 100% syntax. Elixir has one additional and widely used feature: macros. In Elixir, as in Lisp, you can transform your code as a data structure into new code. This is importantly used in Ecto, the de-facto object data mapper in Elixir. It’s also used in Absinthe, a library from the posted link for making GraphQL APIs.
- schneidmaster 7y agoYeah, this is fair. I was mentally lumping certain language features under "syntax" but that's not really accurate.
- ramchip 7y agoProtocols are also an important feature. `IO.inspect`, `Enum`, etc. are very nice additions.
- elcritch 7y agoIn general the standard library organization is superb and well laid out. It’s the only language I don’t have to consistently lookup "how do I do X with string", or “Y with a list".
- out_of_protocol 7y ago* consistent standard library (huge win IMO) * efficient utf8 binary strings (which is actually conforms with utf8 standard), no mixup with charlists * mix etc standard tooling * macros * enum stuff * pipeline operator "|>", which by its mere existence enforces input/output param's consistency in user-written functions etc