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
pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 13898 124
New
crabonature
I’m still quite new to Elixir. As I understand we got in Elixir “multi guards” as convention to simplify one large guard with or’s?: de...
New
WolfDan
After doing a port from a c++ library to my project in phoenix I’ve seen that I need a faster way to run this algorithm and I found this ...
New
marciol
Please, let me know if this kind of discussion already took place in another topic . Hi all, how do you consider if is better to build ...
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
jsonify
So, is Heroku the only free option for hosting Phoenix/Elixir at this point? I’m not ready to commit to paying monthly and was wondering ...
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New

Other popular topics Top

greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
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
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52238 488
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35953 110
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126226 1237
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XX...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement