News for hackers. Stuff that matters.

Ask HN: Why isn't F# more popular?

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.

My question for more experienced F# programmers: What are the F#'s downsides which prevent its more widespread usage?

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?

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.?

( 113 comments | 49 points | on HN )
Re:Ask HN: Why isn't F# more popular? by pritambarhate on Wednesday May 31, 2017 @07:58AM (#14451772)
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.

Also since all popular and dominant languages are either Object Oriented and/or Imperative, functional programming concepts seem too alien.

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.

Re:Ask HN: Why isn't F# more popular? by willvarfar on Wednesday May 31, 2017 @08:17AM (#14451854)
There are also lots of passionate hobby programmers who are passionate about results rather than the journey.

I mean, I know a ton of obscure and esoteric languages. Do I turn to them, even the cool ones, when I want to implement some idea I have? I'm afraid I often turn to the tried and tested boring languages because of the network effect. Increasingly I just use raw javascript, which is right up there with VB and PHP for unpopularity, just because it makes it damn easy to share the result with others if its in a web-page.

Re:Ask HN: Why isn't F# more popular? by douche on Wednesday May 31, 2017 @10:33PM (#14457544)
Exactly. I have been infatuated with F# for over a year, but it is very hard to abandon C# for my work projects. At least, it's a way of jacking the bus factor to one, which makes me nervous
Re:Ask HN: Why isn't F# more popular? by m_fayer on Wednesday May 31, 2017 @08:19AM (#14451864)
Agreed. At some point, if your language(s) of choice are decently powerful and you are decently good at them, you don't feel yourself shackled by a lack of agility, expressivity, or capacity for producing something of quality. Rather, you feel fluent. I mean, I feel a little uncool having never more than dabbled in functional-first languages. But I'm also an adult who has shipped multiple products without any undue tooth-pulling and rather enjoyed the process. So it's hard to take my feeling of uncoolness all that seriously.

And then the motivation to pick up not only a new language but a whole new paradigm just doesn't seem that urgent or appealing, especially when compared to that new bit of infrastructure which will oh-so-obviously add a significant new tool to your toolbelt.

Re:Ask HN: Why isn't F# more popular? by narimiran on Wednesday May 31, 2017 @08:54AM (#14452074)
> At some point, if your language(s) of choice are decently powerful and you are decently good at them, you don't feel yourself shackled by a lack of agility, expressivity, or capacity for producing something of quality. Rather, you feel fluent.

I consider myself fluent in Python.

But in my case, that was the extra reason to try to learn something new and different, and after searching for a suitable second language, I kinda settled for F#. (I have also tried Haskell, but never managed to move past some basic examples)

Re:Ask HN: Why isn't F# more popular? by emperorcezar on Wednesday May 31, 2017 @01:22PM (#14454258)
Most 9 to 5 programmers can stick with the mainstream languages then. I'll be doubling my productivity by learning idioms that don't come in the Java/C# book.

Productivity isn't always measured by direct output. If I write something with 20% overhead that is 3x more robust, then it's worth it. This is what I see F#/Clojure/Haskell providing.

Re:Ask HN: Why isn't F# more popular? by ice109 on Wednesday May 31, 2017 @09:42PM (#14457346)
lol maybe you're a Haskell ninja but I'm still 10x more productive than you because I don't have to implement every single piece of the app (ecosystem++).
Re:Ask HN: Why isn't F# more popular? by emperorcezar on Thursday June 01, 2017 @02:58PM (#14463339)
That's why you'd use Clojure and have access to the entire Java ecosystem.
Re:Ask HN: Why isn't F# more popular? by maxxxxx on Wednesday May 31, 2017 @08:58AM (#14452092)
Agreed. I have tried using F# in my company but gave up after a while. Reasons:

- it's hard to hire people

- most libraries are written for OO style so most code will be written OO style

- most sample code is written in C#

- C# is a pretty nice language. Does F# really provide an advantage?

- will MS abandon F#?

I really would like to see a clear case for F#. When you consider factors like hiring and existing ecosystem the case for F# is not clear to me.

Re:Ask HN: Why isn't F# more popular? by usgroup on Wednesday May 31, 2017 @09:21AM (#14452246)
Data wrangling is a really clear case. I do a tonne of this and it's so much easier in FP.
Re:Ask HN: Why isn't F# more popular? by maxxxxx on Wednesday May 31, 2017 @09:51AM (#14452474)
I can see that. I wish I was in a more self contained environment. But most of us have to glue many different systems together and then FP is harder to pull off.
Re:Ask HN: Why isn't F# more popular? by vram22 on Wednesday May 31, 2017 @02:54PM (#14454975)
Why is data wrangling easier in FP? Is it because of functional composition being like using Unix pipelines (inside the same program)? But one can do that in a procedural language that has functions too.
Re:Ask HN: Why isn't F# more popular? by lobrien on Wednesday May 31, 2017 @06:25PM (#14456417)
Yes, functional composition in part. And while pretty-much-everyone has first-class functions now, they're usually not _quite_ as easy to declare and use as they are in F# (e.g., if you have to specify `Func<string, Func<string, int>> Foo` rather than `let Foo s1 s2 = ... `

Another data-wrangling thing easier in F# (not FP in general) is type-providers.

Re:Ask HN: Why isn't F# more popular? by vram22 on Wednesday May 31, 2017 @06:30PM (#14456448)
Thanks.
Re:Ask HN: Why isn't F# more popular? by usgroup on Thursday June 01, 2017 @09:14AM (#14459939)
In the clojure case, it's because you've got a handful of data types and a massive amount of functions for manipulating them which you just need to glue together in a pipeline.
Re:Ask HN: Why isn't F# more popular? by narimiran on Wednesday May 31, 2017 @09:06AM (#14452137)
> it's hard to hire people

Many other commentators said something like this, so it seems to me that:

Not many people are using F#, because it's hard to find employer who needs F#. And employers don't seek for F# programmers, because there are too few of them.

Re:Ask HN: Why isn't F# more popular? by AstralStorm on Wednesday May 31, 2017 @11:19AM (#14453185)
Moreover, there seem to be no big codebases written in F#.
Re:Ask HN: Why isn't F# more popular? by brjohnstmsft on Thursday June 01, 2017 @02:21AM (#14458360)
AFAIK all of https://jet.com/ is written in F#.
Re:Ask HN: Why isn't F# more popular? by mabbo on Wednesday May 31, 2017 @08:34AM (#14451962)
Scala may be worth a look. You can write libraries using it and pop them into Java code like it's no big deal. There's a few caveats and gotchas, but overall I've been pretty happy with what it's allowed us to do (Apache Spark in Scala especially is lovely).
Re:Ask HN: Why isn't F# more popular? by hota_mazi on Wednesday May 31, 2017 @09:36AM (#14452344)
Scala's future is very unclear, pick Kotlin instead.
Re:Ask HN: Why isn't F# more popular? by AheadOfTime295 on Wednesday May 31, 2017 @04:22PM (#14455596)
Scala 3 first release candidate: https://news.ycombinator.com/item?id=14453196
Re:Ask HN: Why isn't F# more popular? by mabbo on Wednesday May 31, 2017 @12:36PM (#14453834)
Really? I hadn't heard that. Got a reference?
Re:Ask HN: Why isn't F# more popular? by daxfohl on Wednesday May 31, 2017 @08:22AM (#14451885)
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.

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.

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 (https://fsharpforfunandprofit.com/posts/13-ways-of-looking-a...) and lots of different "styles" of how 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).

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.

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).

Re:Ask HN: Why isn't F# more popular? by narimiran on Thursday June 01, 2017 @04:31AM (#14458763)
> I've done plenty of freelance projects in F# over the past few years and enjoy it

Could you give some examples of what did you do in F#? Did you choose F# just because you wanted to see if you can do it in it, or did F# have some advantages over other (functional) languages?

> It takes a while to figure out your style however. (...) Some people end up with "C# in F#" (...) And until you figure that out, it's hard to be as productive as in a language you already know.

My plan is to avoid as much as possible "writing Python in F#", because I choose F# as an opportunity to learn something new/different (which might transfer to writing better Python later). Any tips for this?

Re:Ask HN: Why isn't F# more popular? by pkese on Thursday June 01, 2017 @07:46AM (#14459470)
So far I've used F# form smaller projects, basically anywhere there's any un-trivial problem. Just the fact that the editor helps you write correct and concise code means that once you correct the mistakes that the editor (Ionide) higlights for you, things will just compile and work out of the box.

Compared to Python, I'd assume that 1) I write a bit less code to solve the same problem in F# as I would in Python, 2) it takes a bit more time, but it is more fun, 3) once it compiles, there are seldom any bugs.

So technically you trade some of programming speed for less time spent in debugging and writing test code. In the end, you are way faster and more productive. Especially once the code base starts getting bigger, the type system starts bringing in extra benefits.

Major point is that detecting and correcting bugs in editor is faster than in compilation, and in compilation is better than at testing. So compared to Python, you get 2 orders of magnitude of better and faster development.

Re:Ask HN: Why isn't F# more popular? by daxfohl on Thursday June 01, 2017 @12:08PM (#14461518)
My main project over the last few years has been a photobooth, so I've done server-side in suave (I LOVE suave compared to any other .net framework), client-side in WPF (F# experience in WPF is meh), and a bundle of other mini projects. I did it in F# because it was interesting, not because it was more productive at the time.

My personal landing point is about #6 in the turtles article. I still like classes and interfaces and think they fit perfectly well. However, inheritance is something I avoid completely now. The effect can be done much more flexibly and transparently by several other means. But one great thing about classes is that you get nice autocomplete when you type `myservice.`. And note I only use OO for "services"; data is data is data. So if you're doing DB stuff, prefer an anemic data model and a platform that supports it (so Dapper rather than EF or NHibernate). Basically do `db.Save(myData)` rather than `myData.Save()`.

Another big change I've noticed is I don't use "private" functions much anymore. In OO I spent a lot more energy making sure that people using my classes couldn't use them wrongly. They could only do exactly what the requirements allowed. I think OO mindset (at least in C#/Java, maybe Python is different) makes you paranoid and guides you to putting "app code" into what should be "libraries". This sometimes made e.g. unit testing more of a pain; you can't test your "validate" functions directly because they're private. Now I tend to open most everything up and let developers do what they want with my code, but I add a few helper functions to cover the common cases to guide them in the right direction. In general I consider everything a library now; the only "app-specific" code I write goes in `main` function that glues everything together. Of course I still don't open functions that expose contained services, or that leave things in an inconsistent state, but that's about all.

And of course embrace immutability and recursion (or the library functions that do it for you).

Probably the most annoying thing for you, especially coming from Python, will be "similar records". So you'd need a `User` that just has raw data, `UserDb` that maybe has that plus an ID/DateAdded/DateModified, a `UserOut` that maybe has that minus PasswordHash, a `UserIn` that maybe has RawPassword/RawPasswordAgain, etc, and conversions between them all. Not to mention if you want different schemes for jsonNaming, db_naming, RecordNaming, etc. I've yet to come up with a happy typesafe way of doing this.

Re:Ask HN: Why isn't F# more popular? by vram22 on Thursday June 01, 2017 @03:07PM (#14463421)
> So you'd need a `User` that just has raw data, `UserDb` that maybe has that plus an ID/DateAdded/DateModified, a `UserOut` that maybe has that minus PasswordHash, a `UserIn` that maybe has RawPassword/RawPasswordAgain, etc, and conversions between them all.

Why is this needed in F#? Something to do with immutability?

Re:Ask HN: Why isn't F# more popular? by daxfohl on Thursday June 01, 2017 @03:24PM (#14463586)
This assumes you want to use records for your data: records don't have inheritance. So whereas in C# you could create a UserDb that extends User with the Id/DateAdded fields, in F# that's not idiomatic.

I am sure there could be a good way to automate this using type providers, but I haven't tried it yet.

Re:Ask HN: Why isn't F# more popular? by daxfohl on Thursday June 01, 2017 @03:18PM (#14463524)
I created a gist of the pattern I've found to be most successful when doing an app in F#.

https://gist.github.com/daxfohl/0183db108924ee87440928cb803d...

Re:Ask HN: Why isn't F# more popular? by pc86 on Wednesday May 31, 2017 @10:32AM (#14452815)
I love doing side projects in C#. I'm in it all day at work so I don't need to spend hours figuring out how to configure my local environment or why I'm getting a blank page (horrors from my early days in PHP). If I'm trying to get something out the door to get that sweet, sweet AdSense money, it's going to be in C# unless a static POC site will do.

If the side project is to learn something new, the language is usually what I'm trying to learn, so it's harder to pick what to build rather than which language to use.

Re:Ask HN: Why isn't F# more popular? by ericssmith on Wednesday May 31, 2017 @08:24AM (#14451898)
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.
Re:Ask HN: Why isn't F# more popular? by vram22 on Wednesday May 31, 2017 @02:57PM (#14455001)
>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.

Interesting. Why do you say "including languages that haven't been invented yet"? Does F# have some features that are modern / good, but not common in some other current languages, but are likely to be there in future ones?

Re:Ask HN: Why isn't F# more popular? by narimiran on Wednesday May 31, 2017 @08:59AM (#14452100)
> I would encourage you to stick with F# as you will be further along in not only understanding FP, but other modern programming languages

Thank you for your kind words!

As I mentioned elsewhere, I have also tried Haskell, but I never managed to move past some basic examples. With F#, at least for now, it seems like I can more easily read/understand even more complex stuff (and one day maybe even write it by myself).

Re:Ask HN: Why isn't F# more popular? by hota_mazi on Wednesday May 31, 2017 @09:40AM (#14452372)
Interesting.

To me, Windows has eclipsed both MacOS and Linux as the best dev environment. It's caught up in shell and the whole ecosystem of tools completely blows away what exists on MacOS and Linux.

Windows is also a lot better than the other two in keyboard shortcut support.

Re:Ask HN: Why isn't F# more popular? by gjjrfcbugxbhf on Thursday June 01, 2017 @02:01AM (#14458306)
Interesting. To me windows is a country mile behind linux as a dev environment.

I don't really understand what you mean about keyboard shortcuts though. I thought the windows ones are hard coded into the OS and can't be changed?

Re:Ask HN: Why isn't F# more popular? by hota_mazi on Thursday June 01, 2017 @12:22PM (#14461652)
Everything in Windows has keyboard shortcuts, not so on Linux and MacOS (e.g. you can't open a random menu item with the keyboard).
Re:Ask HN: Why isn't F# more popular? by gjjrfcbugxbhf on Thursday June 01, 2017 @01:58PM (#14462713)
Um yes you can? I mean i do this all the time like many times a day all the time... Alt key is your friend here
Re:Ask HN: Why isn't F# more popular? by hota_mazi on Friday June 02, 2017 @10:27PM (#14474662)
Not on MacOS.
Re:Ask HN: Why isn't F# more popular? by gjjrfcbugxbhf on Saturday June 03, 2017 @02:55AM (#14475348)
MacOS is as unusable as Windows to me.

I think it depends on what you are used to though.

Re:Ask HN: Why isn't F# more popular? by douche on Wednesday May 31, 2017 @10:40PM (#14457585)
Windows is, and has always been, king. There's some halk-baked shit that doesn't behave nicely on Windows, but that's largely self-inflicted.
Re:Ask HN: Why isn't F# more popular? by dgudkov on Wednesday May 31, 2017 @08:25AM (#14451900)
Because Microsoft could've promoted it more but it didn't.

>What are the F#'s downsides which prevent its more widespread usage?

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.

Other than that it's my favorite language for all kinds of tasks -- from production apps to scripts.

Re:Ask HN: Why isn't F# more popular? by narimiran on Wednesday May 31, 2017 @09:14AM (#14452192)
> One is lagging support in Visual Studio

I use VS Code, both for Python and now for F#, and so far my experience has been positive. But that might be because I've used F# only for very basic stuff, and I don't know how better it could be in some other language and/or IDE.

> scripts

I think I'll stick with Python for that :) But I'm thinking about maybe transferring some machine learning stuff from Python to F# in (some distant) future.

Re:Ask HN: Why isn't F# more popular? by douche on Wednesday May 31, 2017 @10:46PM (#14457612)
If you are used to python, and think that VS Code is very nice, you'll be blown away by the tools and functionality that proper VS offers.
Re:Ask HN: Why isn't F# more popular? by narimiran on Thursday June 01, 2017 @04:33AM (#14458773)
> you'll be blown away by the tools and functionality that proper VS offers

I've used PyCharm before, but currently VS Code seems like the right balance for my needs.

Re:Ask HN: Why isn't F# more popular? by gilgoomesh on Wednesday May 31, 2017 @08:02AM (#14451781)
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).

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.

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 decades.

Re:Ask HN: Why isn't F# more popular? by AstralStorm on Wednesday May 31, 2017 @11:25AM (#14453220)
This is mostly because you can do decent functional programming in any language. Including C (though not as nicely). It is a different approach which does not really require much beyond having functions be first class object. It is even easier in OOP ones.

Now if you're talking generic functions and higher order functions, maybe. But those are rarely needed, as you rather want a tuned specific version instead - or a template.

Re:Ask HN: Why isn't F# more popular? by DanielBMarkham on Wednesday May 31, 2017 @08:18AM (#14451856)
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.

What's wrong with ti? I wish F# had more OCAML to it. Functors would be cool.

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.

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.

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.

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.

Re:Ask HN: Why isn't F# more popular? by 1123581321 on Wednesday May 31, 2017 @08:29AM (#14451927)
I "like F#" but there are a few layers between my having some fun a few times a month and a business adopting it.

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.

Re:Ask HN: Why isn't F# more popular? by sametmax on Wednesday May 31, 2017 @07:51AM (#14451740)
Functional languages are less popular. They are harder to learn and to use.

Proprietary platform are less popular. And .net is was very closed at the begining.

Non cross platform languages are less popular. And mono is not really that great on linux.

Plus the usual communication, timing and hype factors.

Re:Ask HN: Why isn't F# more popular? by illuminati1911 on Wednesday May 31, 2017 @08:14AM (#14451847)
I disagree. Functional programming languages are not harder than for example OO-languages. The thing is that people usually learn procedural or OO -paradigm first when they start programming and moving on to FP requires a mindset change.
Re:Ask HN: Why isn't F# more popular? by sametmax on Wednesday May 31, 2017 @08:25AM (#14451902)
Recursion is harder than iteration. Immutability is harder than mutability. Callbacks, dependancy injection, and implicit loops are hard to wrap your head around.

Oop is just a strut with functions and a fancy dress. It's not really a new way to think.

I trained many, many, many people in small groups in programming. The functional concepts are always the hard ones to explain.

And as a dev, even when i deeply understand the benefits of immutability, i find it often being a huge constraint for the most mundane tasks.

Most programmers make simple programs. They don't need complex tools.

Re:Ask HN: Why isn't F# more popular? by gagege on Wednesday May 31, 2017 @08:37AM (#14451977)
I think you're forgetting what it was like to learn your first programming language. A lot of concepts in procedural programming and OOP are hard to wrap your head around at first (static, by ref or by val, the difference between base classes and interfaces).
Re:Ask HN: Why isn't F# more popular? by sametmax on Wednesday May 31, 2017 @08:50AM (#14452053)
You don't have to learn any of this in python, ruby or php. Oop or functional doesn't need to mean low level.

Lower level is harder no matter the paradigm.

The features I mentioned are functional no matter the level.

Re:Ask HN: Why isn't F# more popular? by lkitching on Wednesday May 31, 2017 @09:02AM (#14452114)
Neither callbacks nor dependency injection are functional concepts, and implicit loops are pervasive in Ruby (and non-linear control flow in general). OO in Ruby is quite a long way from structs + function pointers.
Re:Ask HN: Why isn't F# more popular? by dagw on Wednesday May 31, 2017 @08:26AM (#14451908)
This matches my observations as well. My university used Haskell as its intro language for Math and CS students, and the people who struggled the most where those who already knew a bit of programming in another language, but weren't really strong programmers. Those who had never programmed before had, on the whole, no great problem understanding Haskell, but then got completely lost in the follow up course that was taught in Java and focused on OO.
Re:Ask HN: Why isn't F# more popular? by UK-AL on Wednesday May 31, 2017 @07:54AM (#14451750)
I believe f# works on .net core.
Re:Ask HN: Why isn't F# more popular? by sametmax on Wednesday May 31, 2017 @08:19AM (#14451859)
I don't believe any serious project uses only core
Re:Ask HN: Why isn't F# more popular? by UK-AL on Wednesday May 31, 2017 @08:20AM (#14451869)
That's because it hasn't been around for that long. But I defiantly know of companies starting to introduce it.
Re:Ask HN: Why isn't F# more popular? by pella on Wednesday May 31, 2017 @08:04AM (#14451787)
Re:Ask HN: Why isn't F# more popular? by narimiran on Wednesday May 31, 2017 @08:49AM (#14452046)
Thanks for both links! It'll be interesting to see if something has changed in public opinion in last 9 months.
Re:Ask HN: Why isn't F# more popular? by pkese on Thursday June 01, 2017 @06:03AM (#14459067)
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.

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.

Re:Ask HN: Why isn't F# more popular? by pkese on Thursday June 01, 2017 @06:18AM (#14459122)
It might be worth also looking into ReasonML, which is a very similar language, but gets some of F# issues right, like:

  - Targeting native compilation and javascript transpilation out of the box
  - Proper functionally architected libraries
  - (including React and React-native for GUIs)
  - Ocaml style functors
  - Easy syntax for people who are familiar with javascript
  - Prime-time promotion by a large company (Facebook)
  - Targeting unikernels (i.e. MirageOS) makes it geek/buzzword compliant
The only downside for ReasonML right now I guess is that the tooling and developer experience (especially on Windows) is nowhere near to what F# / .Net core / VS Code+Ionide already offers on all platforms (Win/OSX/Linux).
Re:Ask HN: Why isn't F# more popular? by keithnz on Wednesday May 31, 2017 @08:57AM (#14452086)
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.

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.

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)

Re:Ask HN: Why isn't F# more popular? by daxfohl on Wednesday May 31, 2017 @09:24AM (#14452263)
I think this nails it. C# is a really good language. F# has some advantages, some disadvantages, but there's not much clamor for something better in the dotnet world.

Java and Objective-C are far behind as languages, so the motivations for Scala, Clojure, Kotlin, Swift were far greater.

Re:Ask HN: Why isn't F# more popular? by dragonwriter on Wednesday May 31, 2017 @09:29AM (#14452299)
That's part of it, but I think the fact that "the .NET world" is largely enterprise, with is both less sensitive to language quality and more averse to change (whatever quality it brings) than much of the rest of the dev world is also a factor.
Re:Ask HN: Why isn't F# more popular? by keithnz on Wednesday May 31, 2017 @09:37PM (#14457328)
do you have an evidence for that? It seems a weird thing to say when C# is such a high quality language, and C# (and .net) keeps adapting and changing.

There are some advantages with stronger functional languages. Though C# seems to be slowly but surely working out how to incorporate more functional ideas. Though never will be a "functional language" but will support a functional approach.

Re:Ask HN: Why isn't F# more popular? by nickpeterson on Wednesday May 31, 2017 @05:32PM (#14456100)
I've always wondered if you ported F# to the JVM if it would suddenly become much more popular.
Re:Ask HN: Why isn't F# more popular? by wayn3 on Wednesday May 31, 2017 @06:58AM (#14451538)
javascript is insanely popular and its obviously shitty. popularity correlates very lightly with quality.
Re:Ask HN: Why isn't F# more popular? by narimiran on Wednesday May 31, 2017 @07:31AM (#14451658)
That might be true, but I'm more interested in reasons behind it. Surely it isn't something like "well, this seems like high quality, therefore I will not use it".
Re:Ask HN: Why isn't F# more popular? by wayn3 on Wednesday May 31, 2017 @07:47AM (#14451731)
i didnt say that people dont use it BECAUSE its good. that its good simply doesnt matter to them.

almost nobody is using erlang. one of the best languages out there.

Re:Ask HN: Why isn't F# more popular? by eddieroger on Wednesday May 31, 2017 @08:10AM (#14451820)
Betamax was superior to VHS. VHS won. Best is only one aspect. As was said elsewhere here a few times, functional programming is a different paradigm for most people, and learning new stuff is hard, especially when deadlines are at play.
Re:Ask HN: Why isn't F# more popular? by hota_mazi on Wednesday May 31, 2017 @09:49AM (#14452457)
> Betamax was superior to VHS.

Actually, that's a myth.

One of the reasons why Betamax lost is because a tape could only contain one hour of film, so you needed at least two tapes for a single movie. VHS didn't have this limitation.

Re:Ask HN: Why isn't F# more popular? by neoeldex on Wednesday May 31, 2017 @08:12AM (#14451826)
What's so shitty of javascript? From what I've heard is that people's opinion has changed about that. Javascript is evolving, and so is the ecosystem.
Re:Ask HN: Why isn't F# more popular? by sametmax on Wednesday May 31, 2017 @08:31AM (#14451941)
Js was a terrible language with a great platform. Now it's a terrible languages, with a lot a make up to make it look decent, and an a powerful and rich yet very unfriendly and unstable ecosystem.

The only reason js has any success at all is the web.

Re:Ask HN: Why isn't F# more popular? by JepZ on Wednesday May 31, 2017 @08:36AM (#14451975)
At its core Javascript is a good language. Some of the problems come from the fact that at its core it is a functional language, but for years it was marketed as object oriented. And when you look at the language and expect something object oriented or procedural then you will see a very bad language.

Another aspect is the fact that many of the Javascript's problems were actually not problems of the language itself but of the environment around it, like DOM and AJAX implementations in different browsers.

Besides those major problems, the language itself has some minor problems. But as you pointed out the language has a very active ecosystem around it, which creates at least 5 solutions to every problem. But many solutions involve new languages which compile to javascript. So practically the problems are solved but the theoretical use case of writing plain Javascript is still a little problematic.

Re:Ask HN: Why isn't F# more popular? by AstralStorm on Wednesday May 31, 2017 @11:33AM (#14453290)
At the core JS combines dynamic and weak typing.

It is not even object oriented, so instead it is commonly used with the prototype approach.

It is not a functional language either as functions can define global variables, therefore they aren't actually functions. And defining global state is the default behaviour.

Re:Ask HN: Why isn't F# more popular? by wslh on Wednesday May 31, 2017 @08:19AM (#14451865)
Node.JS specifically has a lot of libraries in certain domains not available, with the same maturity, in other programming languages. For example, in the cryptocurrency space there are good libraries (e.g. Ethereum web3 support) but when you try to use similar ones in Python they don't have the same level of support.
Re:Ask HN: Why isn't F# more popular? by AstralStorm on Wednesday May 31, 2017 @11:36AM (#14453317)
And when you use Java you can actually access even more libraries that do not exist in JS world. Including Ethereum web3 support. It even has a much more stable runtime.

Why did you choose JS again?

Re:Ask HN: Why isn't F# more popular? by wslh on Wednesday May 31, 2017 @04:32PM (#14455674)
You can check by yourself that the web3j doesn't have the same capabilities of the official web3 version: https://github.com/web3j/web3j/wiki/Roadmap I am not arguing against Java, just saying that there are tons of libraries written for Node not available in other programming languages. Another example is the BitPay infrastructure.
Re:Ask HN: Why isn't F# more popular? by agounaris on Wednesday May 31, 2017 @08:16AM (#14451851)
Users don't care about imperative, functional, object oriented or what coffee you drink in the morning... stop calling languages shitty and get some shit done with the language you feel more comfortable with. We don't code for the shake of coding.
Re:Ask HN: Why isn't F# more popular? by wayn3 on Wednesday May 31, 2017 @08:28AM (#14451918)
Doesn't change the fact that javascript is shit.
Re:Ask HN: Why isn't F# more popular? by AstralStorm on Wednesday May 31, 2017 @11:28AM (#14453250)
Very deployable but bad still as new versions are not widely available while old ones are crippled.

This is why there have been so many languages built on top of it.

Re:Ask HN: Why isn't F# more popular? by DennisP on Wednesday May 31, 2017 @09:02AM (#14452117)
While I was doing .Net (up until a couple years ago) I really wanted to use F#. But:

- Microsoft had no real support for using it in web projects.

- 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.

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.

Re:Ask HN: Why isn't F# more popular? by robinduckett on Wednesday May 31, 2017 @08:11AM (#14451825)
Because it's a really hard chord to play on Guitar.
Re:Ask HN: Why isn't F# more popular? by dsschnau on Wednesday May 31, 2017 @08:26AM (#14451906)
"If you want to rock out, rely on F#" -Tom Morello

https://youtu.be/aJXzY9vhqZg?t=339

Re:Ask HN: Why isn't F# more popular? by brudgers on Wednesday May 31, 2017 @09:06AM (#14452138)
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.

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.

Re:Ask HN: Why isn't F# more popular? by lobrien on Wednesday May 31, 2017 @06:35PM (#14456471)
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.

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.

Re:Ask HN: Why isn't F# more popular? by dvfjsdhgfv on Wednesday May 31, 2017 @02:26PM (#14454788)
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)
Re:Ask HN: Why isn't F# more popular? by keithnz on Wednesday May 31, 2017 @09:49PM (#14457372)
F# seems quite popular in linux/mac using mono .NET, I was quite surprised in the F# forums how many didn't even use windows. I actually used my Mac for a lot of F# coding. But the new approach from MS for cross platform is .NET Core which (maybe next year as it seems a bit messy at the moment) will be a great cross platform choice.
Re:Ask HN: Why isn't F# more popular? by wcummings on Wednesday May 31, 2017 @07:40AM (#14451694)
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.
Re:Ask HN: Why isn't F# more popular? by rubber_duck on Wednesday May 31, 2017 @08:37AM (#14451981)
IMO the biggest thing with F# is that all the improvements over C# are incremental.

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".

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.

Also F# has it's own warts, like compilation order based resolution :(

Re:Ask HN: Why isn't F# more popular? by jetti on Wednesday May 31, 2017 @10:49AM (#14452939)
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#.
Re:Ask HN: Why isn't F# more popular? by eof on Wednesday May 31, 2017 @08:22AM (#14451884)
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).
Re:Ask HN: Why isn't F# more popular? by amriksohata on Wednesday May 31, 2017 @01:19PM (#14454210)
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.
Re:Ask HN: Why isn't F# more popular? by hacker_9 on Wednesday May 31, 2017 @07:52AM (#14451743)
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.
Re:Ask HN: Why isn't F# more popular? by UK-AL on Wednesday May 31, 2017 @07:55AM (#14451756)
F# is basically .NET Ocaml which relies heavily on its type system. I wouldn't compare it to LISP, except for that its functional.

it seems to me you're just not a fan of static type checking.

Re:Ask HN: Why isn't F# more popular? by plinkplonk on Wednesday May 31, 2017 @09:42AM (#14452395)
(I'm an experienced functional (Haskell) programmer)

I have no interest in F# because I don't want to work in Windows (and the dotNet platform in general).

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)

Re:Ask HN: Why isn't F# more popular? by pkese on Thursday June 01, 2017 @05:45AM (#14459016)
Funny. I'm also love Linux, but for me, the combination of .Net Core/Standard, Visual Studio Code and Ionide provide by far the best programming toolset/experience of anything I have ever seen in my 30 year programming career.

And all of it works on Linux just as well as it does on Windows.

Re:Ask HN: Why isn't F# more popular? by nunez on Wednesday May 31, 2017 @09:26AM (#14452276)
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.

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).

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

Re:Ask HN: Why isn't F# more popular? by fsharp-fan-18 on Wednesday May 31, 2017 @08:57AM (#14452083)
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.

It's sad because F# is a fine language. Just not a popular one.

Re:Ask HN: Why isn't F# more popular? by mtw on Wednesday May 31, 2017 @08:23AM (#14451888)
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?
Re:Ask HN: Why isn't F# more popular? by lobrien on Wednesday May 31, 2017 @06:08PM (#14456318)
I prefer F# as my day-to-day, but I can understand why, for day-to-day challenges, a lot of devs might look at some language features and say "C# has something that's pretty similar." However, use-cases that can be solved elegantly by pattern-matching, type providers, and/or computation expressions are areas where the "C# is good enough" argument is harder to make.

One set of use-cases where pattern-matching are particularly valuable is parsing and other times when you're deconstructing / transforming a complex structure.

One use-case for a type provider would be, say, taking an XML schema and exposing its structure as a compile-time constraint.

One set of use-cases where computation expressions are valuable relate to (oh god I don't want to use the "M"-word) the creation of a small DSL that isolates some type of specialized computation on a parameterized type. For instance, the (built-in) `async` computation expression.

Those might sound like fairly esoteric use-cases, but they're really not that uncommon if you do DSL / library development.

Re:Ask HN: Why isn't F# more popular? by dsschnau on Wednesday May 31, 2017 @08:19AM (#14451861)
I worked with it and while its technically a probably a good language it's nowhere near as easy to get shit done with it as C#.
Re:Ask HN: Why isn't F# more popular? by daxfohl on Wednesday May 31, 2017 @09:08AM (#14452155)
I disagree with this. As someone with over a decade of C# experience and a few years F# experience, I'm more productive in the latter. However it did take about two years to get to that point, and the productivity difference is only marginal. So if you account for the ramp-up time, this is probably true.
Re:Ask HN: Why isn't F# more popular? by lobrien on Wednesday May 31, 2017 @06:18PM (#14456374)
I'm no believer in silver bullets, but I wonder about "the productivity difference is only marginal." For one thing, I think being an F# dev is likely to improve one's OOP code (immutability by default, smaller methods), so while I agree that it might feel like one is similarly productive, I think one changes one's baseline.

For another, I think it really boils down to maintainability. Elsewhere in this thread, there is a comment that "return to your code in 6 months and it's incomprehensible." As a guy who worked with a large Scala codebase, I totally "get" that, but the thing with "functional code you haven't seen in 6 months" is: It's either incomprehensible or it's MUCH easier to reason about than stateful OOP code. And the "incomprehensible" stuff tends to fall into a couple different categories (lifting and conversion, complex function composition, etc.) that gets at least a _little_ better once you've hit your head against them a few times.

Re:Ask HN: Why isn't F# more popular? by chicocode on Wednesday May 31, 2017 @09:32AM (#14452321)
Why is not easy to get things done?
Re:Ask HN: Why isn't F# more popular? by bbcbasic on Wednesday May 31, 2017 @07:38AM (#14451684)
I think it's two things.

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.

Secondly most of the libraries you interop with are C# and so you have to go through interop which is more annoying.

Re:Ask HN: Why isn't F# more popular? by ZenoArrow on Wednesday May 31, 2017 @07:52AM (#14451744)
C# interop doesn't seem that hard:

https://fsharpforfunandprofit.com/posts/completeness-seamles...

Also, from what I've read it's easy enough to use F# code from C# if you wrap it in an object. F# is multiparadigmatic, including support for FP and OOP.

Re:Ask HN: Why isn't F# more popular? by chicocode on Wednesday May 31, 2017 @09:37AM (#14452352)
I think interop is not hard, but F# still enforces functional way over imperative. Write imperative code on Scala is easier then write imperative code on F#
Re:Ask HN: Why isn't F# more popular? by ZenoArrow on Wednesday May 31, 2017 @03:28PM (#14455231)
Okay, but wrapping functional F# code in .NET objects abstracts the functional internals away from C#. C# code can then use the F# object as if it was using a C# object. Does that address the issue you were referring to, or were you referring to something else?
Re:Ask HN: Why isn't F# more popular? by jmcomets on Wednesday May 31, 2017 @08:19AM (#14451860)
What's surprising is that Scala/Java basically has the same issues, but Scala seems to be more popular due to early adoption by several industry actors (Twitter IIRC).
Re:Ask HN: Why isn't F# more popular? by daxfohl on Wednesday May 31, 2017 @08:31AM (#14451943)
Scala is also far closer to Java than F# is to C#. You can write Scala code that looks almost exactly like Java code.
Re:Ask HN: Why isn't F# more popular? by bbcbasic on Wednesday May 31, 2017 @05:59PM (#14456272)
I think the strength of the C# language vs. Java is a factor in this.