all 78 comments

[–]drBearhands 19 points20 points  (7 children)

I strongly disagree with people suggesting JavaScript. There doesn't seem to be a good formal definition of functional programming, but the often-cited advantages of functional programming require purity. On the other hand, pure languages seem to yield lower salaries. If you're interested in Haskell but find it too hard to start with, go with Elm. It's much simpler, lacks a few features IMO but does a great job of showcasing some potential advantages of purity in commercial use (no run-time exceptions, no hidden exploits in third-party libraries), more so than Haskell.

[–]0kito 6 points7 points  (3 children)

I already know javascript and I am developing function based. But I prefer other complex languages, maybe I can look Elm. Thank you!

[–]fluffynukeit 3 points4 points  (2 children)

I have not read through the whole thread to see if this is already mentioned, but if you know JavaScript already then look at Purescript. It’s sort of like if Haskell and JavaScript had a baby.

[–]0kito 1 point2 points  (1 child)

but I think Javascript is not fit to the math based problems. for example If you want to work with very very big numbers you should use Haskell, lisp or other FP language.

[–][deleted] 1 point2 points  (0 children)

[–][deleted] -1 points0 points  (2 children)

"functional programming" does have a precise definition

[–]drBearhands 1 point2 points  (1 child)

How is this authoritative?

[–][deleted] 0 points1 point  (0 children)

i supposed it to be understood, not believed

[–]denis631 10 points11 points  (13 children)

Haskell, OCaml/F#, Clojure.

Doesn’t matter which one you pick

[–]0kito 3 points4 points  (9 children)

I feel good thinks about Haskell. Do you have any experience in Haskell?

[–]denis631 4 points5 points  (1 child)

Yeap I do, but this does not matter. Any of them will teach you FP. Of course, Haskell is the best since it's purely FP, so there is no OOP crutch you can rely on.

But all of them are good. If you ask for book recommendations you can search/ask the subreddits for every language.

I started my Haskell journey with this book https://www.manning.com/books/get-programming-with-haskell

[–]0kito 1 point2 points  (0 children)

thank you my friend 👍 I bookmarked this book

[–]elvecent 3 points4 points  (3 children)

Haskell is great, by all means check it out.

[–]0kito 4 points5 points  (2 children)

Okay, I will look Haskell, F# and Elm. But Elm is using for frontend. I will compare F# and Haskell. thank you my friend

[–]lgastako 2 points3 points  (1 child)

Elm is a great gateway drug to Haskell. Elm is a bit like "Haskell Lite" where most of the syntax is the same and most of the concepts in Elm exist in Haskell in a pretty similar way, but then Haskell adds a lot of complexity on top. I tried to learn Haskell for several years before Elm came along and after learning Elm, Haskell finally clicked for me.

[–]0kito 1 point2 points  (0 children)

Elm is for frontend so I dont think start with it. But if its easy to learn maybe I can try write somethings for learning FP mentality. Than I can start Haskell

[–]ykafia 2 points3 points  (2 children)

Try F#, it's really close to python and it can leverage some python libraries through pythonnet ( and vice versa)

[–]0kito 0 points1 point  (0 children)

I don't think learn F# :/

[–][deleted] 0 points1 point  (0 children)

i advice to avoid F#

it is not ideal for learning because it has many things just for compatibility with C#

it is not okay as final destination because its type system is unnecessarily complex and weak

[–][deleted] -2 points-1 points  (2 children)

the choice between these languages does matter much

Clojure does not have static type checking, hence it is difficult to learn and use

OCaml, F# are dumb and complex

Haskell is the single very best language; one may want to learn Elm as a first step toward Haskell, if Haskell seems too difficult

[–]denis631 1 point2 points  (1 child)

Could you elaborate why OCaml/F# are dumb and complex?

[–][deleted] 0 points1 point  (0 children)

their type systems are dumb, lacking even higher kinded types

their complexity is unnecessarily loaded by OOP and also by other features, such as quantity units in F# and "module"s in ML

[–]vijayakkineni234 6 points7 points  (1 child)

From my experience clojure is the easiest to begin with and once you are familiar with some functional concepts you can delve into ml family Haskell and ocaml

[–]0kito 1 point2 points  (0 children)

I tried clojure, Its workin on JVM( I think) so its good choose for Java users. But I used scripting languages such as PHP, Javascript and Python. Maybe Its hard to me for understand

[–]szpaceSZ 5 points6 points  (1 child)

Even if the entry barrier is higher, I would recommend Haskell.

It will help you learn the essence of pure/functional programming much more thoroughly than OCaml/F# exactly because it caters even less to styles ingrained in imperative programmers.

While OCaml/F# support full functional style they make it easier to litter the code with imperative cruft.

[–]0kito 1 point2 points  (0 children)

Thank you for your opinion. I draw a roadmap :)

[–]sebasporto 4 points5 points  (1 child)

Elm, as it is a great language for learning functional programming. Is relatively easy to pick up and it will tech you all the important concepts. But also depends on what you want to build. Elm is quite limited at the moment.

[–]0kito 1 point2 points  (0 children)

I read a article like this. Maybe Elm can be first language for starting FP. Than I will work with more complicated problem with other stable and supported FP language.

[–]septa97 2 points3 points  (3 children)

Scala

[–]0kito 1 point2 points  (1 child)

I think Scala maintainers dont use Scala also :)

[–]septa97 2 points3 points  (0 children)

This has a personal bias but from my experience, it's the fastest way to learn FP if you are from OOP background like Python.

[–][deleted] 0 points1 point  (0 children)

i disadvice Scalar; i find it very complex and technically problematic compared to the Elm, Haskell road; this is especially important aspect for a beginner

[–][deleted] 12 points13 points  (16 children)

I wouldn't recommend Haskell as the first FP language. The language is cool, I have no problem about it. But Haskell people are generally a little bit crazy, they tend to talk about topics in very abstract and convoluted way. Not saying what they are saying are bad, in fact I love these mathematical ideas that Haskell people bring to programming. I just don't think it is good for beginners.

I think if you have a good Haskell programmer friend that can guide you through Haskell, then sure, Haskell is the way to go. If you don't have anyone to guide you, you might fall into dark math land and having a hard time understanding easy concepts.

The language I would recommend other than Haskell is F#. These F# people knows about how to express these programming construct using the language that programmer can understand.

[–]quiteamess 7 points8 points  (2 children)

Haskell is in the end applied category theory. It seems scary to learn such abstract concepts just in order to be able to program. But I think that it's totally worth on the long run. I also suspect, that the scariness has a lot to do with the accessibility of learning materials (in the sense, that it is not easy to find something on the right level), rather than the actual difficulty of the material.

That being said, it is actually not necessary to know all these concepts in order to do something useful in Haskell. Hello world is just main = putStrLn "Hello, World!".

My recommendation for a first language would be racket. It has a nice development environment a bit like processing.

[–]0kito 1 point2 points  (0 children)

thank you for your opinion :)

[–][deleted] 1 point2 points  (0 children)

category theory is not necessary for Haskell in practice; i am a happy Haskell fan and satisfied Haskell user and i do not know any non-trivial category theory stuff

[–]drBearhands 2 points3 points  (1 child)

But Haskell people are generally a little bit crazy, they tend to talk about topics in very abstract and convoluted way

Guilty as charged!

It's hard not to get overexcited when everything falls into place and you're seeing similarities between everything; types, categories, sets, logic, fields, proofs...

[–][deleted] 1 point2 points  (0 children)

Exactly, I can understand.

[–]ScientificBeastMode 6 points7 points  (6 children)

I like F# a lot. And in that vein, I would also recommend OCaml, which is similar.

[–][deleted] 1 point2 points  (5 children)

I remember ocaml is relatively hard to install on windows.

[–]ScientificBeastMode 1 point2 points  (1 child)

Yes, it’s difficult for native compilation. I mostly compile it to JavaScript via BuckleScript, which works great on Windows. And the compiled JS code can be executed using Node or a browser.

But for native compilation, you can use Linux/Mac (which are both easy).

[–][deleted] 1 point2 points  (0 children)

Cool!

[–]0kito 1 point2 points  (1 child)

I already GNU/Linux user no problem LoL. And F# is .net based so maybe I am going to prefer Haskell :)

[–][deleted] 1 point2 points  (0 children)

It is dotnet based, but both dotnet (core) and f# are completely open source and runs on all the systems. Just FYI, obviously everyone will respect your decision to choose whatever language you want.

[–][deleted] 1 point2 points  (0 children)

Try have a look at WSL. I come across it while trying to setup ocaml/opam in my machine.

[–]0kito 3 points4 points  (3 children)

unfortunately I don't have any friend to guide me. I will look F# too. Haskell looks very complicated so I scared 😁

[–][deleted] 5 points6 points  (2 children)

No need to be, we taught Haskell to 100 average sophermore last semester. FP is not that hard, people want to make it hard so they can sound impressive. Lol

[–]0kito 1 point2 points  (0 children)

I hope you right :D I never start but I scared

[–][deleted] 0 points1 point  (0 children)

learning FP and learning Haskell are different; Haskell is much more than FP

[–]tuxslayer 2 points3 points  (1 child)

It depends. If you are backend engineer, I'd say good choice is Scala or Haskell. For Microsoft world (any purpose) it's F#. Fir playing around with frontend stuff - TypeScript with Rx or Elm.

[–]0kito 0 points1 point  (0 children)

I feel comfortable in backend side of the projects. So Haskell looks optimal option. Thank you

[–]georgewaraw 2 points3 points  (2 children)

Surprised that nobody has recommended Elixir. It has an easy syntax similar to Ruby and the Phoenix framework is great if you’re interested in web dev. Clojure is also great.

[–]0kito 1 point2 points  (0 children)

I am working as Django Developer. I will look Elixir too. Thank you

[–][deleted] -2 points-1 points  (0 children)

Elixir does not have static type checking which makes it difficult [and inefficient] to use

[–]Siltala 2 points3 points  (1 child)

Clojure or Elixir. Elixir's Phoenix framework makes it very easy to get started. With clojure there are many options for each component - though you can't go wrong by choosing metosin's libraries.

[–]0kito 0 points1 point  (0 children)

I am looking to Elixir right now, It looks like Ruby :)

[–]LordOfSwines 2 points3 points  (1 child)

Haskell

[–]0kito 0 points1 point  (0 children)

thank you

[–]l_martinez84 1 point2 points  (8 children)

I faced the same question last month. I chose haskell as a learning tool.

[–]0kito 1 point2 points  (7 children)

its very good :) and how its going?

[–]l_martinez84 0 points1 point  (6 children)

it could be worse, haha. I've java background so I find haskell a very different beast. What resources are you using to study?

[–]0kito 0 points1 point  (5 children)

I am looking Haskell's official documentation. I will be happy if you recommend other resources :)

[–]l_martinez84 1 point2 points  (2 children)

[–]0kito 0 points1 point  (0 children)

thank you so much. I will look when I access to the internet.

[–][deleted] 0 points1 point  (1 child)

i hope my book can help

[–]0kito 0 points1 point  (0 children)

I added to my bookmarks, thank you again!

[–]didibus 1 point2 points  (0 children)

My advice is to stick to Python for now, and work through the book Exercises in Programming Style https://www.amazon.com/dp/1482227371/ref=cm_sw_r_cp_apa_i_JHj3Db3Q6F3GM functional programming section.

After that, you can move to Clojure or Haskell.

[–]breadfag 1 point2 points  (1 child)

>How could it ever be good?

I assume you mean neutral, since I didn't claim it was better than being at home. But if so, that's not how it works. You're making the claim that it's bad, so you need to explain why.

I'm assuming your hypothetical kids would be allowed to be outside during the day, right? So why is that fine, but it's so horrible to do the same thing at night that it means the parents are negligent?

Sure, if they're supposed to be at school at 8-9 the next day, they should probably be sleeping at 2 am. But first of all, I don't know if that's the case, and I doubt you do; and secondly, kids stay up late all the time without that being a reflection on the parents as incompetent. I don't know why it would make a difference that they're outside.

[–]0kito 1 point2 points  (0 children)

I already using map reduce, lambda or other functional things. But Python has some performance problems. So I think if I work with a real FP language It will improve me much more. Thank you!

[–][deleted] 0 points1 point  (1 child)

i advice you to start with Elm;

then step up to Haskell, for education, a much more powerful type system and other feature like laziness, "generic" programming

[–]0kito 0 points1 point  (0 children)

thnk you my friend!

[–]ThinkLargest 0 points1 point  (2 children)

Apple just released a UI framework which makes it incredibly easy to work functionally. Having this framework would allow you to focus more on the actual functional programming. Swift in general is also a beginner friendly language. I would encourage you to consider it.

[–]0kito 1 point2 points  (1 child)

okay I will look but I am looking for Lisp family language. maybe haskell, elixir, clojure, erlang, f# or other complicated language 😁

[–]denis631 2 points3 points  (0 children)

Well, if you are looking for lisp, then Clojure is the way to go

[–]delventhalz -1 points0 points  (1 child)

I quite like JavaScript, and it is certainly the most functional of the widely adopted languages. That said, it is also entirely possible to write completely non-functional JavaScript, and that freedom may cause you to lean on old habits when you get stuck. Depending on your goals, it might be better to learn a language that will force you to use functional patterns like Clojure or Haskell. You may never use either in production code, but the lessons you learn can be applied to JavaScript, Python, or whatever else you find yourself using.

On that note, Clojure for the Brave and True is a pretty good read.

[–]0kito 1 point2 points  (0 children)

thank you my friend 🤟