I want to learn a functional programming language. Which one do you recommend learning in 2017?
I want it to be useful enough for practical tasks like web servers, scraping html, programming puzzles, etc.
Python is as easy and simple as it gets.
>>60719510
I already know Python, Java, C++, C, JavaScript, Go. I want something that forces me to write functional.
>practical tasks
>programming puzzles
JavaScript since you already know it. But what are you going to do with it? If you don't have a good use case you're going to just end up passing around state in your functions. You can do monads in JavaScript.
>>60719657
SICP my friend.
Scheme of if you want a language with more features, Common Lisp.
A more modern Lisp is Racket, which is way more functional than both.
Basically, Common Lisp can be function, but its mainly multi paradigm, and it uses lots of imperativity.
If you want something simple, Scheme, and no doubt SICP.
clojure.
Haskell
Lisp by far is the easiest language to learn functional programming. The fact that functions are lists that begin with a function name makes it very easy to visualize high order functions. And since all data is also made up of lists it just makes it that much more easy to see how functions work on data and are data.
>>60720401
suka
>>60719489
Rust and Swift.
>>60719489
>functional
Haskell or Common Lisp
Or you use Python but it's not purely functional.
Erlang is too special but nice.
>>60719657
>>60723264
Sorry, didn't read it. Forget Python. If you do it to learn functional programming, then go for Haskell. It's pure and you're going to learn a lot using Haskell.
Common Lisp isn't that pure and teaches you more about macro and metaprogramming (which is quite fucking powerful).
Erlang teaches you about developing fault-tolerant distributed systems but is a bastard-child of Prolog and functional programming. Still fucking powerful.
You should learn Haskell if you want to learn the concepts but don't plan to use the language itself for anything serious. Overwise, you should look at Rust, since it's close enough to Haskell while being as fast as C++.
Oh, and Lisp is as much "functional" as Python or Ruby, i.e. it has lambdas and can return functions from functions, that's all.
>>60719489
Use OCaml. Start by installing opam then build the latest version with it. You can get utop which is the GOAT toplevel.
>>60719489
Elixir
How can people claim Python is even sufficiently functional if it doesn't have function concatenation anywhere near a primitive concept. You can do
def c(f, g): return lambda x: f(g(x))
def h(x): return x + 20
print c(h, h)(5)
but this is a horror with type mismatches. If doesn't even have functions, you manipulate update global variables within each function call and have the return value depend on the current value.
you can manipulate/update*
>>60719489
In what kind of use case would a functional language be better?