Why F# could be the next mainstream programming language
I wholeheartedly believe that F# could be the next, big mainstream programming language. At the very least it has a lot going for it—to wit:
- Seamless interoperability with .NET, which means you have access to a huge package and infrastructure ecosystem our of the box
- Language pragmatism; unlike Haskell or Scala, F# is not a vehicle for programming language research, and is not mixed up in any orthodoxies regarding purity or other design choices
- Good tool support; F# works great with Rider and Visual Studio out of the box, and there’s also Ionide for VS Code.
- Proper functional programming; F# is a true ML-like with currying, HM type inference, immutability by default, sum types etc. IMO this gives it an edge over Kotlin and Typescript who kind of flirt with FP but are too afraid to fully commit (which means they keep dragging OO baggage like
null
and exceptions along with them) - Less power than Scala or Haskell. F# invites you to write boring, obvious code, compared to Scala or Haskell where you’re free to paint outside the lines. This kind of power is great for experts, but if you want to drive adoption and increase the success rate for “programming in the large”, less is usually more.
Let me go ahead and make a bold claim: I believe that F# is a strictly superior choice for enterprise business applications than most mainstream languages.
So, what’s the catch? For the moment, F# still has some drawbacks:
- The pool of F# programmers with industry experience is small—minuscule, even—especially when compared to C#. However, I think this sounds like a worse problem than it is; F# has a pretty smooth learning curve, so beginners can be onboarded quickly.
- There is still a lot to be desired with respect to tooling; compiling large projects can be quite slow, I’ve never gotten the test debugger to work properly in VS Code, etc.
Both of these problems are eminently fixable.
If you’re a functional programming junkie looking for your next “hit”, F# will probably leave you disappointed. It does have some unique and interesting features, such as type providers, active patterns and computation expressions, but overall it doesn’t offer as power or excitement as something like Scala or Haskell. However, if you want to ship software on time, on budget and to spec, in a way that scales to large teams, I would urge you to give F# a shot.