r/functionalprogramming • u/Tuckertcs • Nov 16 '25
Question .NET/React dev looking to start FP, which language should I pick?
Looking to start learning functional programming and would like some advice on which language(s) I should start with.
I primarily use C#, TypeScript, and occasionally Rust to build websites (React) and APIs (.NET, Express, or Axum), and occasionally CLIs. What language(s) would be a good choice for these use-cases?
I seem to hear a lot about Haskell, Elm, and PureScript, but I'm a bit unsure which to pick. PureScript compiling to JS seems cool, but would I be able to build React/Express projects but replacing TypeScript for PureScript? Or would I just end up writing FP domain code with a bunch of JS glue? Otherwise, I'm not super clear about the ecosystems for each language, so any advice on picking a language that has a good ecosystem of libraries for web UIs, web APIs, CLIs, DB connections, etc. that would be amazing!
9
u/josh_in_boston Nov 16 '25
Seconding the F# suggestion. You can do everything and it'll be the least different from what you've used vs. Elm, PureScript, etc.
17
u/fasttalkerslowwalker Nov 16 '25
If you want to be able to access the .NET universe, sounds like F# could be your jam. If you’re good with a smaller ecosystem and a newer language, give gleam a gander—it’ll give you a lot to like if you want a rust-/ocaml-ish algebraic type system. Gleam is in my current sweet-spot because i think it has better error messages than F# and I much prefer explicit imports.
I started with clojure and think there’s a lot to recommend it, but eventually gave up because dynamic typing and inscrutable error messages made debugging and refactoring a total nightmare. Its macro system and metaprogramming never ‘clicked’ for me, so there could be an upside here I never cracked into.
5
u/ShacoinaBox Nov 16 '25
f# lol not even a question, if anyone says anything else just write it off. f# now, immediately, asap. I think it's by-far the best introduction given your history.
3
u/jfinch3 Nov 16 '25
You can get pretty far within C# and TypeScript these days, and it might be worth looking at something like “Functional Programming with C#” to start so you aren’t learning a whole new paradigm while also working on the new syntax.
TS also has a ton of support for functional patterns with first class functions. You could explore things like fp-ts or Effect, both of which can give you a better grasp of FP concepts and will help your current work, without needing to dive into something totally new.
But outside of that, might as well go for F# since it will help expand your power in the .NET world
5
u/Merthod Nov 16 '25
Elixir should be worth a look. Elixir + Phoenix is like NextJS done right, although not perfect.
Recently saw they published F# 10. Wildly unpopular compared to its sibling, C#.
OCaml is also worth a look if you want the "C" of functional languages.
5
u/KarthikChintala Nov 16 '25
Have you tried Clojure?
4
u/VestigialThorn Nov 16 '25
Since your focus seems front end, maybe Elm first.
But really pick one and try it out, and move to the next if it doesn’t vibe. F# is the only purely functional language I’ve got production code in. And I’ve learned so much by trying out others, especially Haskell and Clojure.
You may even just try starting to bring in functional paradigms into your current TypeScript development. There are tons of resources for this. My introduction was a book, Functional JavaScript, which has had one of the biggest effects on how I write and reason through code. And consider functional libraries like Effect or FP-TS.
4
u/willehrendreich Nov 16 '25
Fsharp for the win! It's a wonderful Lang. Https://www.github.com/ChrisMarinos/FSharpKoans
3
u/Massive-Squirrel-255 Nov 16 '25
OCaml transcompiles to JavaScript and webassembly is a work in process. I know that the OCaml.org website is written in OCaml but I am not a web developer so I cannot give you too many examples. OCaml's ecosystem is not super rich but there is often one good mature library for each problem domain. OCaml is distinguished from other statically typed functional languages such as Haskell and Purescript by its unique module system which is highly expressive and permits code reuse and abstraction in a way that goes beyond traits, typeclasses and interfaces in most other languages. It is a relatively simple language in many ways, for example it has no overloading and its type system is the standard Hindley-Milner type system without subtyping or other complex things that tend to break type inference.
3
u/drBearhands Nov 16 '25
Elm. Sure it's further away from what you're used to thatln F#, which is a good reason to learn Elm rather than F#.
You will not be able to build react projects. Elm has The Elm Architecture which takes advantage of the language's purity.
Compares to Haskell and PureScript, Elm is simpler, but it's also more pragmatic and will help you focus on what makes FP great.
3
u/arturaz Nov 16 '25
No idea why reddit doesn't allow me to post this directly, so I put my thoughts on why you should use Scala in a gist: https://gist.github.com/arturaz/169c19d7c3e77b062834057d96df651a
2
u/jyooi Nov 16 '25
Elixir
2
u/willehrendreich Nov 16 '25
https://www.github.com/falcoframework/Falco.Datastar for front end!
2
u/sarabadakara Nov 17 '25
Check out Rescript. I often get annoyed at how tightly coupled it's design is to React, but if you're working with react anyways...