Live data from Hacker News

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

news.ycombinator.com

101–110 of 115 posts

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

#101
post #97

Earlier quoted context omitted.

> 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 (s…

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.

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

#102

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

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?

#103
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?

#104
post #103

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

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?

#105
post #29

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…

> 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 t…

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?

#106
post #80
post #57

Earlier quoted context omitted.

Data wrangling is a really clear case. I do a tonne of this and it's so much easier in FP.

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.

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?

#107
post #29

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…

> 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 t…

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?

#108

Earlier quoted context omitted.

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.

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?

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?

#109

Earlier quoted context omitted.

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?

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

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?

#110
post #93

Earlier quoted context omitted.

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.

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

That's why you'd use Clojure and have access to the entire Java ecosystem.
Post reply on HN