kostonstyle

kostonstyle

Comparing Elixir with Haskell

Hi all

How can I compare haskell with elixir, included tools, webservices, ect.

Thanks

Most Liked

Qqwy

Qqwy

TypeCheck Core Team

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 :wink: .

All right, these are just my two cents. Any other questions? :slight_smile:

12
Post #2
dwahyudi

dwahyudi

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.

bobbypriambodo

bobbypriambodo

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.

Last Post!

brandonhamilton

brandonhamilton

In terms of distributed systems, Cloud Haskell is a library modelled after OTP to provide ‘Erlang-style concurrent and distributed programming in Haskell’

Where Next?

Popular in Discussions Top

New
rms.mrcs
A couple of days ago I was discussing with a friend about different approaches to write microservices. He said that if he was going to w...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
New
AstonJ
If so I (and hopefully others!) might have some tips for you :slight_smile: But first, please say which area you’re finding most challen...
New
chuck
Let me start by stating an assumption: Phoenix is a great approach to building REST APIs. There are many reasons for this, but I will ass...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New

Other popular topics Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49134 226
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42576 114
New

We're in Beta

About us Mission Statement