Hacker News new | ask | show | jobs
by mhanberg 1081 days ago
I'm not really following your comment about "more functional style".

Which are you saying is more functional? And why?

1 comments

I'm not the one you asked but elixir's heavy use of piping data through a series of functions is a hallmark of a certain approach to functional programming. It's not "more functional" since that doesn't really make sense per se, but for a lot of people when they think of FP this is the fundamental orientation they have in mind, rather than like function composition or whatever.

Erlang doesn't have a first class pipe macro or special form I don't think, and its standard library isn't built with this in mind, with consistent data-first argument order. So again it's not "less functional" but it doesn't much use one of the most recognizable idioms of functional programming and the only uniquely functional one many people may be familiar with.

I don't know if this is what they meant but it makes sense to me. In elixir piping streams is an ergonomic and similarly performant solution, with the tradeoffs discussed in the article. There's a lot of use case overlap. If the language didn't have comprehensions it wouldn't be very painful for most people, I don't think. Where erlang without them would be a pain in the ass it really has no other general purpose tool for this.

I interpreted their message as saying Erlang is more functional than Elixir, which didn't really make sense to me personally. (I think they are both the same amount of "functional")