r/functionalprogramming • u/j_gitczak • Jan 12 '25
Question Which functional programming language should I learn?
I have recently discovered the world of functional programming and I want to learn a functional programming language.
For most of my life I have programmed in Python and I have always liked its onelined expressions like list comprehension and lambdas.
I also value good error messages in a programming language (not some segmentation fault or NullPointerException bullshit), and this is also why I like for example Rust.
I study Mathematics so I like the idea of a programming language being "mathematical" which I heard Haskell being decribed like, and Haskell is what I initially thought would be the best to learn, but I don't want to exclude other languages, so that's why I'm making this post.
I don't plan on ending my functional programming journey on one language, so I want to first learn one just for fun, so it doesn't matter if a language is used in industry or not.
I would really appreciate some recommendations for the language I should learn.
View all comments
Show parent comment
3
u/P3riapsis Jan 13 '25
Agda is pretty good, maybe not as smooth as the more conventional functional languages like Haskell, but when you need the dependent types and proofs it's smooth enough that I've heard of it being used in production code in industry even.
Heard good things about lean 4 too, of all places I met a type theorist in a game of counter strike, and they basically use lean 4 as their primary programming language. Personally, I never really got into using lean precisely because lean 3 and newer are inconsistent with univalence.
warning: ramblings about HoTT
I still can't tell if the HoTT hype train is on to something, my gut thinks it's too beautiful amd human of an idea to not be, but practically it's still too painful for me to keep my mind on it for long hahahaha. I guess it's more painful because I recognise that HoTT as a mathematical foundation works in much more humanly intuitive way than classical foundations, but because of it being so much less developed than set theories my human brain just can't grasp it with anywhere near the intuition I've got from years of working in ZF-like set theories.
Honestly, outside of those two, I think Idris looks like it might be on its way to providing a really smooth proof assistant experience for people who want to actually do things practically too. Its users definitely market it as an "ordinary functional language with proof assistant capabilities" at least.
warning: ramblings about Idris's type system
Although, as a pure mathematician I've been too scared to have a look because when i was first starting I had fears over consistency of the language. iirc Idris at one point intentionally contained an axiom that made it inconsistent in some way that should almost never impact anything but made the actual user experience smoother, with the intention of finding a way around this later. I didn't really look into it enough to know though, I kinda just assumed it was probably a Russell-like Inconsistency like the "omega-in-omega" pragma in Agda introduces.