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
2
u/P3riapsis Jan 14 '25
Yeah, I think tactics really are the biggest issue in HoTT being practical. The ideas actually feel really natural, but there's just too much of a barrier to using them in proof assistants because in classical mathematics we can get away with sweeping some problems under the rug that you can't with a computer. A human can basically just accept when two objects are the same "up to a suitable notion isomorphism" then all properties that you care about are preserved between those, even if they're not the literal same object (as sets). HoTT tries to allow this to be done in a mechanical way using paths and transportation. There's a general notion of equality that we know satisfies the properties we want, and we have a notion of transporting the proofs about properties for free. The problem is that it's way too clunky to actually use paths and transportation with the current state of tactics. I feel like it could be made so much easier though with better automation.
As for the π₁(S¹) thing being complicated, I think it's almost undeniably easier in HoTT than in classical mathematics. In classical mathematics you need to define and motivate the notions of topological space (took a whole 16 lecture course at my uni) and then realise that even still we have no real way to tell different spaces apart, so we have to introduce a weaker notion of equivalence called homotopy equivalence, and only now are you at the starting point of the HoTT proof. Now you basically do the same proof, but in HoTT a lot of things come basically for free as they're the only possible thing you can do (e.g. the universal cover is basically the only thing possible to write in HoTT, but in set theory foundations you have to mess around with path lifting and proving uniqueness and existence, it's a mess). The result being that you probably need at least 8 lectures in an algebraic topology course to even get to the point of calculating any homotopy groups at all.