(Courtesy of Erlang Solutions).
Readme of all the changes:
Does anyone have some advice?
Choosing which one is a matter of personal preference. Erlang is the best choice if you're interested in concurrency and distributed programming. It's also in a sweet spot where variables are bound once, which forces you to change the way you think. I consider this more important than purity for learning.
Haskell is probably the biggest paradigm shift. I use it a lot and love it. It really does change the way you think, but it is also the steepest learning curve.
Of all the Lisps, Scheme is the simplest and tends to be used functionally more often than Common Lisp. There is an incredible wealth of resources for people learning Scheme, but especially The Little Schemer and Structure and Interpretation of Computer Programs (SICP). I have never made much progress in my copy of SICP, but I got a lot out of the Little Schemer. I said to avoid JVM languages but Clojure is the most modern Lisp, and incorporates a lot of modern functional programming idioms, so it can sometimes have a Haskellish flavor, and it doesn't make circumventing FP all that easy. It's probably the best Lisp of today.
Standard ML and OCaml are both good if it looks to you like Haskell goes too far but in the right direction. OCaml is considered more pragmatic; it's also more widely available and benefits from being a single-implementation language. Standard ML is arguably a more beautiful language, but it suffers from low library availability. Both will encourage functional-style programming, but both provide a fair number of escape hatches. For example, they're not pure and they both have "refs" that let you circumvent variables-as-bindings. But they encourage the style.
I tried many times with Lisp and eventually concluded it just wasn't for me, and Haskell is a better fit. I personally recommend looking at Erlang, Clojure and Haskell, and just throwing yourself into whichever one of them looks "cool" to you. If the language feels unpleasant to you, there's no point in trying to force yourself to go further, but if it seems fun to you, you'll make progress without as much effort.
That alone is a good enough reason to try out the language, in my opinion.
Erlang is more than a functional lang. It has concepts of concurrency and "let-it-fail" which helped to change my view on how to write server apps.
Check me out, I'm about to say a bunch of things as if they're fact, in the hopes that someone will correct me where I'm wrong!
So, a few decades ago two groups of people came to the determination that anything calculable can be expressed through a Turing machine or through lambda calculus.
The Turing machine was sorta step-by-step and nuts-and-bolts and inspired the imperative branch of programming languages.
Lambda calculus is more denotive and inspired functional programming.
Now this part is confusing. Because if you ask "What language should I learn to explore lambda calculus?" people will tend to answer Lisp variants. Whereas if you ask "What language should I learn to learn functional programming?" people will tend to answer Haskell.
I understand the differences between Haskell and Lisp - Haskell is more restrictive and pure, while Lisp is incredibly supple with its code-is-data-is-code approach - but I thought functional programming came from lambda calculus. In other words, I don't understand what lambda calculus is that functional programming isn't or vice versa.
Anyway, what's generally seen as the most "purely functional" language is Haskell. Opinions vary on how pragmatic a language it is to learn (as judged by job openings and active projects), but it's widely seen as the language to learn if you want to learn and "get" functional programming concepts most efficiently. In other words, learn some Haskell, and it makes other functional languages easier to learn.
My basic choice (as an imperative programmer that knows java, perl, php) was whether to learn some kinda java-esque functional language, or Haskell, or a lisp variant (including java-esque lisp like Clojure). I'm choosing to learn Haskell, and then move over to Scala, since I hear and suspect that is a better way to learn Scala than to go directly to Scala, and since I'm interested in enhancing my existing body of knowledge rather than switching career paths entirely.
BTW, there's a third big family of programming language, logical programming languages (Prolog, etc). I thought I saw that Erlang is influenced by some concepts from that. So at least in my head, it has seemed like Erlang is the language I'd want to learn if I really wanted to blow my mind with a mixture of functional, concurrency, and logical-programming concepts.
It's a bit like wondering what part of procedural programming is using a turing machine and which part isn't. :) The theory is theory and the practice is practice; in the end, what you're using is pretty far from it but it retains some of the flavor.
The flavor of lambda calculus is one of substitution and reduction. Expressions are evaluated, values replaced, variables bound. Even something like Scheme is pretty far from it, but it is close enough that if you want to study one the other will help.
The basic lambda calculus you hear about is usually the original untyped lambda calculus. The typed lambda calculus isn't much more worse, but bears a stronger resemblance to ML and so forth.
I have not found the absence of a background in lambda calculus to be much of an impediment to learning and applying functional programming. Presence of the word "calculus" tends to make us think something is grand and mystifying. In this particular case my impression is that it is an interesting theoretical diversion and that's about all one needs to know.
> I thought I saw that Erlang is influenced by some concepts from that
Well... Erlang was originally implemented in Prolog. And the syntax borrows from Prolog in many places. However, Erlang is absolutely not a logic programming language because there is no unification happening within it. It is really cool in its own right though.
The world of logic programming continues to be dominated by Prolog, which is an amazing, somewhat practical and beautiful language, but also warty old hog at the same time. Mercury gets brought up from time to time, and it should be amazing, but lacking a repl it leaves me cold. Apart from these two there are a handful of multiparadigm languages that have some constraint handling, such as Oz or one of the embedded Prologs for Lisp (Allegro has a good one), and then there's things like CLIPS or Jess or JBoss Drools, but for dedicated logic languages it's still essentially just Prolog.
I'm a huge fan of Prolog, by the way! I don't think it helps much with learning functional programming but it definitely will blow your mind, and probably more than FP would too. If you wind up trying it out and getting stuck, drop me a line or ask a question on SO. I frequently leave huge answers there and the community is very friendly.
if you are already an experienced programmer, bits of it may seem trivial, but avoid the temptation to skim; following along all the way through will genuinely introduce you to the functional way of thinking.
You might consider, if the syntax is just too painful, looking at elixir. Elixir is effectively erlang but with a more ruby-like syntax. I think elixir exists for other reasons, but the syntax being more readily accessible to ruby developers is a nice side effect.
Not sure if elixir is the best way to learn functional programming, as I knew elrang before learning it, but it is a nice language, it is not a "hipster" language, and it has great support especially given how relatively new it is.
is a pretty good place to start.
I also recommend the book, "Erlang and OTP in Action." Don't fall into the trap of trying to reinvent the things OTP provides.
But a question: It says it's using Erlang 13B. Do you recommend using a newer version, or trying to compile/finding an old binary version of 13B? (I mean, is Erlang 16 compatible with 13, or they tend to break things?)
(I'm sure I'll find this out eventually when I start the tutorial, but it's always good to know this kind of things beforehand)
The thing is, elixir is really just erlang with some extra features (which are really compelling to me) and some syntax changes that make it much more readable to non-erlangers. (or at least, I believe it would.)
But secretly, you're learning erlang. And afterwards the transition between the two will be seamless (Because they're really the same language.)
I would definitely recommend anyone that wants to try Elixir, to at least try learn some erlang first. The learn you some erlang book is pretty fantastic.
So 16B is the complete, ready for production version of 16.
Next release will be 17A, or 16B2 if there are bug patches required.
Also, it may seem weird that a "programming language" is having an update each year. (how many times a decade is C++ updated?) But this is because erlang is really a complete platform. The language is just part of it, but OTP, the platform is a hidden gem that gives erlangers super powers.
This also means, each year, your code gets better as the platform itself gets better.