r/functionalprogramming • • Dec 02 '24

Question What languages to start learning FP?

The purely functional languages I know off the top of my head are Haskell and Elixir, but I know there’s plenty more.
What’s generally recommended as the best language to learn pure FP?

Note that I’m not a complete beginner in programming. I’m far from experienced but I know more than just the basics

30 Upvotes

41 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Dec 02 '24

[removed] — view removed comment

1

u/haglobah Dec 02 '24

I mean, I'm not infinitely certain, but I think the 'pure' in 'pure FP' comes from pure functions (meaning 'functions as we know them from Math').

Then, pure FP is the branch of FP that gives you tools to ensure the purity of functions (e.g. Haskell), in contrast to Elixir or Clojure, which don't.

So it's "programming with almost only pure functions", rather than "A language that lets you program in a functional way only". Since there are no pure objects (afaik), Smalltalk isn't called a "pure OOP" language.

3

u/larryobrien Dec 02 '24

It's objects all the way down in Smalltalk. Primitives, the environment, the ST syntax itself. I've absolutely used the phrase "pure OOP language." Can't see why that's wrong. (I mean, there's a low-level implementation and at least the old commercial STs could call C binaries, but that's quibbling.)

1

u/Inconstant_Moo Dec 09 '24 edited Dec 09 '24

Well it depends what you want from a language. "Flexible and fun" isn't always the highest priority. Sometimes the people you're writing code for/with don't care how much fun you're having nor are they keen to have the code written in a DSL of your own invention. Sometimes the type-lego aspect of Haskell looks very nice, and the fearless composition.

Also, it's not purity that makes Haskell difficult. Elm is pure and is (by repute, I don't do front-end stuff) easy to learn and fun to use. My own language is flexible and fun and has pure functions.