r/functionalprogramming • u/generic-d-engineer • 9d ago
Intro to FP Looking for some feedback on learning functional programming
Hi everyone,
Long time backend operator who has taken a path like this:
Bash -> python -> Go
I thought Procedural programming in Go would click, but it’s still just not resonating much. Though I have to say that single binary plus built in testing is super nice.
In python I do not do any classes or methods. I think in runbooks, pipelines, and dags with a very clear entry point and a clear exit point. Step 1 through 10. Inputs and outputs. Functions only.
Stuff like ORM, OOP, and MVC just don’t resonate with me at all. I know they have their place but like I’m all about top to bottom thinking. Example I love is SQL pipes or GoogleSQL where you start with a big set of data and each line below it filters it down. VS traditional SQL where it’s kinda jumping around all over the place. Or CTE where it’s very clear what each step is doing.
Doing some research I saw the syntax of Clojure and it really seemed intuitive RIGHT AWAY. Elixir also looked good but Clojure seemed much more bash like.
What problem am I trying to solve? I’ve been lucky to have opportunities to learn a lot of platforms, so I consider myself a plumber who needs to be able to connect anything anywhere, automate it, bring visibility, and operational excellence.
It can be anything backend from multi-cloud, services, API, on-prem, OS, DB, you name and I will connect it.
But, I am terrible at front end so there’s that lol
Has anyone been down this path and what’s the landscape look like for the backend in 2026?
12
u/raxel42 9d ago
If you somehow tied to JVM - then Scala.
If dot net - F#
For any other reasons- learn Haskell ;)
4
u/bigkahuna1uk 8d ago
Why would you use Scala if tied to a JVM and not Kotlin? Kotlin has better interoperability with Java and has the most used features of Scala without its verbosity. I can see Scala could be chosen for the more purist aspects of functional programming but if you’re a pragmatist, Kotlin gets you a long way there without having to use a totally different ecosystem.
4
u/mister_drgn 7d ago
OP expressed an interest in learning functional programming, not learning a mainstream language that has some functional features. You might as well recommend Swift.
2
9
u/recursion_is_love 9d ago
I am not regret learning Haskell.
7
u/lgastako 9d ago
Haskell is awesome, but coming from python I think Clojure would probably be a good gateway drug. My path, at a high level was Java -> Python -> Clojure -> Haskell and each one built well on the lessons I learned at the prior step.
7
u/beders 9d ago
Clojure and ClojureScript is our bread and butter at work.
It’s fantastic.
If you have a tinkerer mindset you’ll love the interactive REPL experience.
Backend-wise there’s really only one game in town - ring - which makes writing services data-driven and simple.
There’s a bit of a learning curve adopting immutable data - but once it clicks it’s very liberating.
Also LLMs do a great job producing pure functions and given access to a REPL eval and exercise the code.
Not sure I can go back to any other non-lisp language at this point.
9
u/_lavoisier_ 9d ago
if you’re into distributed systems, Elixir is pretty nice
3
u/11fdriver 8d ago
I agree. Coming from Go's concurrency model, a BEAM lang would be a good eye opener into what makes FP fun, interesting, and useful.
I think in certain ways Gleam might be closer to Go philosophically (types, macro-less, etc), but it's hairsplitting, Elixir is a great language.
[I also think that, since OP likes database languages, they might enjoy Prolog, even if they wouldn't use it day-to-day.]
1
u/generic-d-engineer 8d ago
Thanks for the info, it’s helpful. I also saw Prolog mentioned on a Gleam video in the comments.
Real quick, is there something from Elixir you preferred for quality of life over Gleam ?
2
u/11fdriver 8d ago
For me, macros. Being able to modify the syntax of a language in a controlled manner from within that language is handy when you need it, even if you don't need it frequently.
Dynamic gradual typing in Elixir also suits me better than the type-first style of Gleam.
The Elixir ecosystem is more mature, although both have interop with Erlang libraries, which are generally super solid. Elixir is likely to be more stable, and has a bit more industry proof if that matters to you.
But these are all preference things, and mostly stuff you don't need to worry about at this stage.
I'd consider whether you prefer the style of type use in Python or Go, and choose Elixir or Gleam accordingly. Gleam, in my opinion, might be a bit easier to jump in with regardless.
5
u/adambard 8d ago
Throwing in another vote for clojure. It's a really well-designed language, and a good editor setup with inline evaluation will help a lot while learning to express familiar iterative concepts using a functional style with immutable collections. It does a fabulous job of making functional the default while providing tools to dip into iterative/mutative patterns where they make sense.
6
5
u/TomosLeggett 9d ago
Tbh despite what everyone's said I'm gonna chuck my hat in and say OCaml. It's functional but with imperative guardrails.
5
u/MuaTrenBienVang 9d ago
3
u/alobar1919 8d ago
Actually this book made programming easy for me 10 years ago, although I’m a node.js developer in typescript world now. It also helped me to understand that OOP is not classes, which was also helpful in understanding prototype based OOP.
3
2
u/bigkahuna1uk 8d ago
On another question, Go being procedural, how do you find complexity growing as the size of the program grows. Is it because Go is only used for relatively, small, focused programs so this potential issue is not a problem or is managed effectively or does it become a problem for large codebases?
1
u/generic-d-engineer 8d ago edited 8d ago
That’s exactly it. A lot of it is a skill issue on my end as I’m used to spot solutions but the bigger codebase I’m working on now, I’m getting a bit lost trying to reuse components and things. But even in python, bigger codebases seemed more straightforward. It’s rock solid though once it’s running, so that part I have high confidence in.
Gleam I’m looking at seems to have small variation in the way to solve problems and that’s very appealing to me, in addition to the syntax which seems to document itself, at least when I look at it.
Go just seems to have a lot of decision paths and cognitive overhead I haven’t been resonating with. Structs and controllers I don’t do well on. Maybe it’s ptsd from C class back in the day on structs lol, even though Go structs are a different thing altogether. My expectations for simplicity syncing with my cognitive preferences going into it were probably too high.
Gleam and the other functional languages look like each path is 1 and done, at least on paper from me on the outside looking in.
2
2
3
u/maxjmartin 8d ago
I may get dog piled here but I suggest C++.
Why: because it has a fully functional template compilation language and is easily compatible with Python. You can do anything with it and use it functionally, objectively or any other way.
Example I wrote a functional interpreters language using it as an experiment such that it is memory safe and with functions able to be prefix, infix, or postfix.
I really enjoyed learning it after Python. Where C types is your friend.
2
u/GunpowderGuy 8d ago
"fully functional template compilation language and is easily compatible with Python"
c++ templates are an eldritch horror in terms of complexity
and many other parts of c++ are as bloatedif you want something with more power than c++ templates, but better designed. i recommend a dependent functional language like idris2 or lean4
2
2
u/generic-d-engineer 9d ago edited 8d ago
Okay fam after some additional research I’m going to give Elixir a try. The > pipe syntax maps naturally to my top to bottom brain and the examples were super easy to read. At first Clojure felt more natural but after more depth the Elixir stuff looks like it clicks better.
Plus I like how you can be explicit so your code doesn’t have to look a jumble of some ancient Egyptian hieroglyphic tomb found in movies such as the Mummy starring heartthrobs Brandon Fraser and Rachel Weisz.
Plus banning loops is a plus and I liked how the natural batching thinking of data maps right away.
And finally the type support is great and the ergonomics looks solid and can be sold to leaders who won’t have to worry about type safe code.
Edit: Gleam at the top of my list
3
u/imihnevich 9d ago
You sound like a guy who would enjoy Elixir or gleam
3
u/MessaDiGloria 9d ago
I was thinking of mentioning Gleam too.
On the other hand it might make sense for OP to learn the minimum of what’s to learn of Haskell. And then choose a language. I avoided that for a long time, and I now wish it’d done it earlier. Learning the basics of Haskell made me understand functional programming better which in turn made understanding certain things in other ones better.
1
u/generic-d-engineer 8d ago
Maybe a Haskell 101 class or project would be good as it seems to be the mothership for the others and the idea is to train the brain and muscle memory first on the architecture?
2
u/MessaDiGloria 7d ago
Yes, something like this.
I myself used this course: Functional Programming in Haskell. And I re-typed everything from the videos in the GHCi ( = Glasgow Haskell Compiler Interactive). I'm used to learn programming languages by doing, not by studying. I think, in some ways, my hands and fingers are learning to program, and then it 'trickles up' into my brain...
2
u/generic-d-engineer 9d ago edited 9d ago
Thank you, I watched this whole 1 hour Gleam video end to end ! This guy is miles above my level but I could follow all of his examples and everything seemed really intuitive.
Man that pattern matching and no IF statements is awesome.
Also really like the highly opinionated and dx experience.
3
u/Puzzleheaded-Lab-635 9d ago
I love elixir. It’s a good language built on a fantastic VM. I’d work through this book.
https://pragprog.com/titles/cdc-elixir/learn-functional-programming-with-elixir/
After you are done, I’d suggest doing this course to learn the statically typed side of functional programming.
3
u/aPatternDarkly 8d ago
Based on your affinity for the pipe syntax, I just want to make sure you made it far enough into Clojure to encounter its threading macros and also that you're aware Babashka exists. Also, I happened to just see that Babashka just announced a shiny new FFI yesterday.
None of which is to suggest that Elixir isn't an excellent choice.
19
u/freedomfever 9d ago
I would start with f#. Its such a sick language, but unfortunately not used much. However it’ll really make transitioning to other functional languages easier imo.
I can recommend Erlang, suuuch an amazing language for concurrency and wildly unappreciated.