I'm coming from Python world and I just started learning F# for fun (and profit ;)). So far, my experience with the language was quite positive, so I was bit surprised to see that F# is not more popular. I guess I wasn't able to see its downsides just yet.<p>My question for more experienced F# programmers: What are the F#'s downsides which prevent its more widespread usage?<p>For other people who have tried F# and didn't continue to use it: Why did you stop? Do you use other functional languages instead?<p>General questions: Is it because of its ties to Microsoft and/or Windows? Is F# not as good as other functional languages (which ones are better, and why?)? Not enough learning resources, examples, etc.?
Most of the programmers do programming for a living. They are not passionate programmers who like to learn new languages. They care about getting things done. Since Java, C#, Python, JavaScript, Ruby and Rails, PHP are all popular and have huge library ecosystem around them, for most of the 9 to 5 programmers, there is little incentive learn any functional language.<p>Also since all popular and dominant languages are either Object Oriented and/or Imperative, functional programming concepts seem too alien.<p>Even though I consider myself a fairly passionate programmer, I haven't found enough incentive to invest proper time to learn a purely functional language. The infatuation with Clojure and Haskell only lasted for a weekend for me. I always think, that next month I am going to invest in learning a functional language, but always something else more shiny comes along from other domain like, Dynamo DB, Firebase, RabbitMQ, etc. Which I find more practical to learn rather than learning yet another programming language.
In corporate, especially in MS shops, to modify an old adage, "Nobody ever got fired for choosing C#". For side projects, I'd imagine most people working on those would rather do something not Microsoft-specific.<p>For me, I've done plenty of freelance projects in F# over the past few years and enjoy it. I've done about two years worth of projects in Clojure, and about a half year in Scala, and F# was the nicest of the three for me.<p>It takes a while to figure out your style however. Since it's a FP-OO hybrid, there are often many approaches to doing the same thing (<a href="https://fsharpforfunandprofit.com/posts/13-ways-of-looking-at-a-turtle/" rel="nofollow">https://fsharpforfunandprofit.com/posts/13-ways-of-looking-a...</a>) and lots of different "styles" of <i>how</i> FP you want to go. Some people end up with "C# in F#" and some go almost to "Haskell in F#". (I personally end up somewhere in the middle). And until you figure that out, it's hard to be as productive as in a language you already know. But once you do, I think F# provides the ability to be more productive than C#. (Granted I think immutable records and `with` syntax would get C# half way there).<p>However I will admit that when it comes time to transition the code back to the owner, I kind of regret using an edgy language. Fact is most workaday developers don't have a ton of interest in new languages and would rather work with something they already know.<p>Most of the pain points are due to running on a runtime designed for OOP. So even though idiomatic F# code shouldn't need null checks or much exception handling, you still need them if you're using C# libraries. There's also an annoying mix of camelCase and PascalCase everywhere (the former for logical consistency: a function is a value, and the latter for consistency with C# conventions).
As a long-time advocate of functional programming, I was once asked after a talk what is the "best" FP language to learn. Since I'm known as a Haskell/Scala/ML person, I surprised much of the audience by answering that I thought F# was the best entry point. What I did not say, however, was that I think that Windows is a challenging environment for anyone who is used to Linux/Mac -- and this includes the "open source" world in general. I think that Microsoft is a leader in language design, but their platform relevance was slipping for many years. I believe it may be on the upswing (with Xamarin etc). I would encourage you to stick with F# as you will be further along in not only understanding FP, but other modern programming languages, including ones that haven't been invented yet.
Because Microsoft could've promoted it more but it didn't.<p>>What are the F#'s downsides which prevent its more widespread usage?<p>The two biggest downsides I've encountered are not related to the language itself. One is lagging support in Visual Studio (didn't support folders for long time, poor cross-language C#/F# navigation, no support in .NET Core projects etc.) and the other is the lack of examples/frameworks for WPF applications when I needed them.<p>Other than that it's my favorite language for all kinds of tasks -- from production apps to scripts.
F# is very popular, for a functional programming language. In 2014 it was the most popular functional programming language on the Tiobe index, excluding SQL (in the latest index it has dropped below Scala, Scheme and Prolog).<p>However, functional programming languages are not highly popular. Most programmers never learn any functional programming languages, choosing instead to learn one of C#, Java, C++, Javascript and stick with it indefinitely. For that reason, F# is stuck in a position of being the number 3 .NET language under C# and VB.NET.<p>That final point is a different topic again: F# is under VB.NET. Few consider Visual Basic to be a great language; it survives on momentum alone. F# is comparatively new; momentum takes <i>decades</i>.
I love F#. Switched over from the other .NET languages as soon as it came out and I haven't looked back. F# helps me to become a better programmer.<p>What's wrong with ti? I wish F# had more OCAML to it. Functors would be cool.<p>Why isn't it more popular? Sad to say, most programmers don't really care about being a better programmer. They care about getting a job, keeping a job, and getting promoted -- none of which might involve learning a functional language.<p>To be fair, there's also a different paradigm programming functionally with larger development teams, a skill that many shops haven't mastered. Three guys in a startup would be fine. Three hundred guys in a mid-sized firm could have a lot of problems switching over. I grok that.<p>I'm kind of surprised F# is as popular as it is. Microsoft deliberately downplayed it when it came out, calling it a "scientific" language. I think that coders realize the open source power the language brings to *nix boxes, the more popular it'll get.<p>Let's put it this way: there are a ton of other languages I've wanted to try, but so many of them just aren't "done" yet -- there's still a crap ton of things missing. F# isn't like that. You pick F# up, you can code just about anything, and the community is there for support. I don't see that advantage changing any time soon.
I "like F#" but there are a few layers between my having some fun a few times a month and a business adopting it.<p>F# makes sense when a) functional programming has a history of being advantageous in the domain, b) there is a mandate or clear advantage to develop in the .net ecosystem, c) a founder or engineering team has serious expertise with F#. Even then you have to ask if a functional-ish C# codebase you can easily add 50 developers to if needed is good enough.
Functional languages are less popular. They are harder to learn and to use.<p>Proprietary platform are less popular. And .net is was very closed at the begining.<p>Non cross platform languages are less popular. And mono is not really that great on linux.<p>Plus the usual communication, timing and hype factors.
I think the main problem is that F# never went beyond .Net platform (e.g. they never released a native compiler). .Net is nice and gets the work done, but the fact that existing .Net libraries are OOP style means 1) they don't fit as nicely into the F# paradigms (see other people's answers) and 2) adoption is easy for people already familiar with .net and not as easy for people coming from other languages/platforms.<p>In addition, inside the .Net world, F# got a role of just "And you can even do functional programming in .Net if you like", rather than "this is a proper way of how people should write safe high-level code". I think Ximian is the only one giving F# proper handling.
I spent a bunch of time using F#, and it is good, but C# is a seriously good language and the advantages of F# kind of turned out to be minimal, and most annoyingly, not well supported by the tooling.<p>On the F# slack channel I asked what was the compelling reason for F#, why isn't it more popular, and basically there wasn't one. There's some stand out language syntax like computation expressions. The community is really good, but F# specific libraries are very quiet, web libraries like suave are ok, but kind of lifeless.<p>More interestingly, when I shifted a bunch of F# projects to C#, it was relatively straight forward. C# has enough syntax to do a lot of things functionally (though not as concise)
While I was doing .Net (up until a couple years ago) I really wanted to use F#. But:<p>- Microsoft had no real support for using it in web projects.<p>- Functional programming would be great for data transforms in SSIS but that wasn't possible either. You'd think with a common VM you could use any .Net language, but no.<p>Microsoft has always treated it as a non-mainstream language, saying "do the regular stuff in C# and use F# for the hard stuff." The problem is that C# isn't terrible for hard stuff, and if you spend most of your time using C#, then for you it's probably better.
Partially because there is Ocamal. Not that it is (or is not) a better language. But because it is older and was historically available on more systems and covers some of the same ground as a descendant of ML. Partially because of Scala which also covers some of the same ground...though not claiming as strong a tie to ML it has strong ties to the JVM.<p>Finally, there are many very good languages. Few are as a popular as Python...one might say even Python isn't as popular as Python, if you know what I mean...anyway, I'm not a big fan of the concept of "functional programming languages" because functional programming is a way of programming and most languages can be used imperatively or functionally and though some make it a bit easier than others most programming languages readily facilitate both. Once it was all the rage to talk about Python as a functional programming language (but making map/reduce/filter second class citizens in the past few years has hurt that story) and there are plenty of resources for functional PHP.
Since you're "coming from the Python world" you have a good case-study in how a bunch of things outside of language design are crucial. Python has essentially won the race to be the next major language among scientists and that's tied up with a virtuous circle of libraries for, e.g., numerics, statistics, data viz, machine learning, and even within many scientific disciplines (e.g., astronomy). The virtuous circle also includes learning resources (books, Websites, conferences) and the ability to have someone check / talk over your code.<p>For what it's worth, F# is trying to get that same virtuous circle rolling, but there are a few areas (cross-platform dataviz, interactive notebooks) where F# just doesn't have quite as good a story as Python.
I do mostly server-side stuff. Practically speaking, for the most part it means Linux programming. Unfortunately, .NET is still a second-class citizen under Linux. Yes, several people report they are using F# without problems under Linux, but I encountered several glitches in the past and don't feel like experimenting until things become more mature. I'm lucky enough to make the choice of the language myself, and I'd give F# a try, but after huge memory leaks and other problems with .NET on Linux a few years ago I got burned and would need a good argument to switch now. There are far better alternatives under Linux (both functional and non-functional)
This is a good question IMO. As functional languages go, it seems like it should be pretty appealing, especially now that .NET is starting to open up a bit. Good runtime, vendor support, can leverage .NET libraries.
IMO the biggest thing with F# is that all the improvements over C# are incremental.<p>Almost every cool feature about F# you show to a C# developer he'll go "OK I can sort of do that in C# it's just a bit more tedious".<p>When you add up those incremental improvements you get drastically shorter code but that is not immediately obvious and that's why you'll have a hard time convincing C# developers switching to F# is worth it.<p>Also F# has it's own warts, like compilation order based resolution :(
I'm a professional C# developer and while I have dabbled in F# it isn't where I ended up when using functional programming languages. I ended up with Elixir and the main reason why is moving off of the .NET framework. There is nothing wrong with .NET but after doing it for a living for 5 years I wanted a change. I really enjoy Elixir and can't see myself going "back" (I was never fully there) into F#.
I like the idea of F#, but do not like programming in the windows ecosystem. I spent years learning/writing haskell (though I write mostly JS these days).
For the same reason most functional languages never took off, they look succinct, but come back to your code in 6 months and its like a war zone. Also not to mention the fact that if you start writing your code base in a niche language that few people want to write in, then it will be very difficult to recruit and you're stuck with a codebase no one wants to write in, you might as well write in Cobol.
I used F# for a time and ended up disliking it. The syntax is poor IMO and some bits are quite quirky. I love using Clojure though for functional programming. Most of F#s ideas come from the Lisp world anyway, but they also tried to shoehorn on a type system. It doesn't work that nicely in the end, and I don't think you get the full power of functional programming because of it.
(I'm an experienced functional (Haskell) programmer)<p>I have no interest in F# because I don't want to work in Windows (and the dotNet platform in general).<p>Yes I could probably make F#/dotNet work in Linux, but at that point I have Haskell, (and SML and OCaml and Erlang). Net, net, in my dev/deploy environment, F# confers no benefit (as compared to the alternatives)
functional languages in general aren't very popular in the enterprise yet. this means that finding talent for more obscure languages like F# is really challenging. You would need some really large org that's willing to make the switch to build a hiring pool around it.<p>which brings me to my next point. the cost of switching languages is really high for most companies and often times the need to do so is driven by a direct business need (like Jet.com and their order processing engine, which ran on F# from the start).<p>Also, C# and to some extent Java are getting some functional-like features (type inference, anonymous functions, pattern matching), so the need to take on a new language entirely to get those features is even lower
Combination of many reasons. See also OCaml. Not the main language of its platform. No killer app. Most use cases better served by other languages.<p>It's sad because F# is a fine language. Just not a popular one.
Is there a practical use case (deep learning, cloning Uber, trading, bitcoin mining, healthtech etc.) where F# or a F# framework is significantly better than what's out there?
I think it's two things.<p>If you write a lot of F# then if anyone leaves you need to replace them and it's harder than finding a C# developer.<p>Secondly most of the libraries you interop with are C# and so you have to go through interop which is more annoying.