Hacker News new | ask | show | jobs
by Xophmeister 4001 days ago
I've been reading about Elixir here-and-there for a while and decided to jump into it last week. I really like it. I'm a big fan of FP and, having increasingly found myself falling out with Python, can definitely see this becoming my dynamically typed language of choice.
1 comments

Would you recommend Elixir for a first FP language? I am familiar with FP from using Python and JavaScript, but I have never used a completely functional language yet. Can I dive into Elixir or should I learn something more "traditional" first such as Haskell, Lisp, etc?
My current feeling [bearing in mind that it's been less than a week!] is that Elixir is to Haskell as Python is to C++. If you want to learn a dynamically typed FP language, then I think Elixir is a fine choice; especially from a JS/Python background, plus all the goodies that come with the Erlang VM. I've read it's also good for metaprogramming, so it ticks the same boxes as Lisp, without having to get used to S-expressions!... It's certainly something you can dive into :)

Then, if you find you're really in to the FP Kool-Aid, I would definitely give Haskell (or OCaml) a try as well. It's a completely different ball game, but even as just a beginner -- I kinda-sorta-understand monads -- I would say that it's already improved my general programming skills.

Thanks for the suggestion, I will definitely be giving Elixir a try!
With this book:

https://pragprog.com/book/elixir/programming-elixir

I would say it's an outstanding choice to learn functional programming. The book is written for someone who knows an imperative language and wants to learn about functional programming.

Dave's book is a great read. I also recommend the Manning book "Elixir in Action" although I'm only half way into it.
I personally didn't understand FP at all until I played around with Erlang (specifically, the "Learn You Some Erlang" book). I reckon Elixir would be similarly enlightening (if not more; I feel like Elixir's macros are easier to wield than most Erlang equivalents, for example).

The friendly, consistent syntax and the imperative-ish constructs in some places can work as a great stepping stone into the rest of the functional/declarative programming world.