Hacker News new | past | comments | ask | show | jobs | submit login

It’s funny because I would take Erlang’s syntax over Elixir’s anyday.



Likewise. I wish I could have Erlang the language w/ Elixir's community and growth.


Can't you? I mean, aren't they interoperable?


The canonical argument order in Elixir is backwards from Erlang (and I will argue just "wrong" with respect to the functional programming paradigm: it is essentially object-oriented corruption... the subject pretty much needs to be the final argument for various forms of functional composition to work; the place where this really becomes clear is when trying to call "reduce", which continues to have the "correct" argument ordering even while almost nothing else does <- though watch me be misremembering the exact place where this clicks as it hasn't been years since I spent a lot of time trying to be happy programming with Elixir :/), so there is a massive impedance mismatch tying to reuse functions and primitives codes in one language from the other (and it almost seems like many Elixir wrappers exist only to reverse the argument order). So, sure: they are "interoperable"... but so are C and Python ;P.


Erlang does not support currying, so having the subject in the last arg does not help much.

Also, the actual ordering is not `func(Args..., Subject)` but instead `func(Args..., Subject, OptionalArgs...)` which bit me more than once.

I like Elixir's consistent use of the first arg for the subject along with the pipe operator, which gives you essentially currying-like behaviour in the first argument.




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

Search: