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.

Where Next?

Popular in Discussions Top

Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
crispinb
On reading dhh’s latest The One Person Framework it strikes me that Phoenix with LiveView is already pretty much this. However, never hav...
New
Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
ejpcmac
I have discovered Nix last month and I am currently on my way to migrating to it—both on macOS at home and the full NixOS distrubution at...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
PragTob
Hey everyone, this has been on my mind for some time and I’d love your input on it! TLDR: I feel like maps are superioer for storing and...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19148 150
New
joeerl
I’m playing with Elixir - It’s fun. I think @rvirding does give Elixir courses these days. Re: files and database - when I given Erlang ...
New

Other popular topics Top

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31107 143
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement