Hi all
How can I compare haskell with elixir, included tools, webservices, ect.
Thanks
Hi all
How can I compare haskell with elixir, included tools, webservices, ect.
Thanks
Well, the most important differences:
Haskell is pure, lazy and statically typed.
Elixir is impure, strict (but using macros you can do lazy evaluation) and dynamically typed.
These differences mean that it does take a little getting used to. Dynamic typing + impurity makes it quicker to āspin upā a new concept, but also easier to make trivial mistakes. Elixirās Actor-Model aspect does mean that programmers spend time thinking about the fault tolerance of their applications, so usually a crash in one part of the program only affects a small part of the application. And also, there exist great tools to write tests. (But still, as someone who comes from, amongst other languages, Haskell myself, I do miss static typing sometimes).
One of the things that you might find lacking in Elixir is that currying is not built in into the language. Also, because the existence of the pipeline operator |>
, the most āimportantā argument of a function is inserted in its first slot (whereas exactly because of currying, in Haskell this would be the last one).
Elixir is built on top of Erlang and uses the Actor-Model for concurrency. This is built in into the language, which means that many system harness its power. There do exist Actor-Model libraries for Haskell, but I have not worked with them so I cannot compare them to Elixir.
From a documentation point of view, Iād say that Elixirās documentation is a lot better than Haskellās at this time. Both to get to know the language, and to look a specific feature up down the line. The great documentation quality is also true for most packages built on top of Elixir.
As for packages/included tools: Elixir brings a lot of power, especially since all tools that are built with Erlang also work with Elixir. Building web applications is one thing that Elixir excels at, and the community has spent (and is spending) a lot of time to build tools that extend Elixirās capabilities in this direction. I would say that Phoenix seems more mature than e.g. Yesod at this time, although Iāve only very little experience with Yesod, so take my opinion with a grain of salt .
All right, these are just my two cents. Any other questions?
Wow. Awesome explaination.
Thanks so much.
While itās not exactly Elixir, but since one of the most compelling feature of Elixir is the Erlang VM and OTP, you might also be interested in this InfoQ interview with Joe Armstrong (co-creator of Erlang) and Simon Peyton Jones (one of Haskellās lead designer).
Topics including how both languages approach concurrency and how functional paradigms are making their way into mainstream use. Towards the end, they also express their arguments for and against either dynamic typing and static typing. Itās quite an informative watch.
I think you can not compare Haskell and Elixir(Erlang), because they have different approach. Erlang was build for distributed system and haskell for, do not know for what.
Actor model in other language, like akka, is not as powerfull like in Elixir(Erlang).
Well Haskell is mainly a research language. And it is not a researchers tool but his subject.
This is a very tired position. Itās also a very unproductive position to take, as it doesnāt at all further either the language or the discussion about it.
Haskell is a very practical language in many areas (some where Erlang and Elixir are extremely impractical by comparison; writing a compiler in Erlang/Elixir would be a bitch, whereas in Haskell itās much easier) and dismissing it as āmainly a research languageā is also basically saying that languages canāt both evolve and be practical at the same time.
Well the question was what Haskell was designed for. And only this view does explain a lot of the decks zooms made during early Haskell.
For sure, you can use Haskell commercially very well, fpcomplete proves it. But still most of Haskell a evolution and tool set is best explained by its origin.
When you have a choice for a distributed system, would you choose haskell over elixir?
Fair enough, good point.
Very likely I would use Erlang/Elixir, but it also depends on how many concurrent entities I would run. If I knew that I would be running a small number of things at once and some/all of them required much higher performance I might as well use Haskell.
If I had only a few parts that had to run more efficiently, Iād likely use Erlang/Elixir together with Haskell, either through ports or ad-hoc communication. Iāve said it before on this forum; I donāt believe there is a better command/control platform than the BEAM. Outside of that, I think Haskell is arguably a better suited language for most things. It just so happens that creating systems relies a lot on command & control.
Haskell sounds to be the master of erlang and elixir.
I donāt know what thatās even supposed to mean. If there was any doubt, I think the BEAM is amazing and for the very specific purpose of connecting things together and having those components communicate with each other in a reasonable way thereās nothing like it.
Entirely different domains between Haskell and Erlang/Elixir. You could easily implement a Port/Node(MaybeEvenANif) in Haskell to use inside Erlang/Elixir, but Haskell and no library for it that Iāve yet seen can scale or distribute like Erlang/Elixir can.
A major difference between Haskell and Erlang, that might define their philosophy and goals:
Haskell was born inside the academic mindset.
Erlang was born inside the business mindset.
Cheers! I so much like this.
In terms of distributed systems, Cloud Haskell is a library modelled after OTP to provide āErlang-style concurrent and distributed programming in Haskellā