[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

I want to learn a functional programming language. Which one

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 19
Thread images: 4

File: 1487376336977.gif (2MB, 270x279px) Image search: [Google]
1487376336977.gif
2MB, 270x279px
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.
>>
File: 1495079952281.jpg (276KB, 857x1506px) Image search: [Google]
1495079952281.jpg
276KB, 857x1506px
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.
>>
File: 1496214718944.png (352KB, 520x414px) Image search: [Google]
1496214718944.png
352KB, 520x414px
>>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.
>>
File: elixir_logo.png (74KB, 400x400px) Image search: [Google]
elixir_logo.png
74KB, 400x400px
>>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?
Thread posts: 19
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.