Live data from Hacker News

What is the case against F#? (2009)

stackoverflow.com

11–20 of 107 posts

Re: What is the case against F#? (2009)

#12
post #10

Most of the time my C# code uses most of the functional paradigms. I write pure functions when i can and use LINQ almost everywhere. Recently i created a F# API with the dotnet CLI, but the syntax is not even close. I get the concepts, but syntax is a little bit to much to just try it when i have to write a new microservice. Am i the only one?

F# syntax is so much better than C# for functional programming - and arguably for object programming too. However, it is sufficiently different that you really need to jump in with both feet. Don't assume it will be easy because you know C#. However, once you start to grok the syntax, you begin to see how the language features elegantly tie together, and the language design decisions make perfect sense. Unfortunately, you just have to take it on faith that this moment will occur... you can't see it unless you put in the time to learn it.

There is a whole series on C# to F#: https://fsharpforfunandprofit.com/posts/porting-to-csharp-in...

Re: What is the case against F#? (2009)

#13
The case against for most people is the chicken-and-egg problem of the mainstream adoption of the language.

It should be relatively obvious at this point that the outright merits of a language have little or nothing to do with its popularity, at least when compared to things like the corporate backing and will behind a language (see: Objective-C / Swift), and other factors such as positioning and luck (e.g. Javascript). So, you cannot start from "this language is _clearly_ better, so it will certainly become more popular".

And this is the problem for most people / dev shops choosing a language. Popularity brings a huge amount of good things, such as good quality training materials, job security, easy hiring, good quality libraries, etc (and a few negative things), so it is kind of a big deal.

Re: What is the case against F#? (2009)

#14

I have frequently come across 'multi-core' code using fancy features of fancy languages (e.g. Scala) that get a 205% speedup on a 8 core machine when I should be getting more of a 750% speedup, not get the same answers every time, etc. The choice in that situation is to risk spending a few days debugging (50% at best success rate) or spend 20 minutes and use a ThreadPoolExecutor and you're done. Java was the first pr…

-> 'correct' is a much better attribute than 'new' or 'shiny'.

F# first appeared in 2005. I think it is safe to say it is not 'new or shiny' anymore.

Re: What is the case against F#? (2009)

#15
post #11

F# is a lot like OCaml. But OCaml still struggles with multiprocessing, while F# can run on the .NET infrastructure which has this solved.

OCaml is still pretty fast and part of RHEL. How good ia linux support for F#? And how hars is it to get mono installed?

Re: What is the case against F#? (2009)

#16

"Asked 11 years, 7 months ago" Has the need to use functional programming languages become obvious yet? Has C/C++ et al. fallen by the wayside, yet?

Didn't they add lambdas to C?

There is a non-standard compiler extension supporting them for GCC, but that's all.

Also, I seriously hope they won't. The whole point of C in this day and age is extreme simplicity and portability. The latest standard, C17, has only corrections. C11 has really all that's needed for "modern" applications, aka a threading library which is not pthreads and decent unicode support.

Re: What is the case against F#? (2009)

#17
post #11

F# is a lot like OCaml. But OCaml still struggles with multiprocessing, while F# can run on the .NET infrastructure which has this solved.

OCaml is still pretty fast and part of RHEL. How good ia linux support for F#? And how hars is it to get mono installed?

Mono? Thought dotnet core now ships[0] for Linux:

0: https://docs.microsoft.com/en-us/dotnet/core/install/linux-d...

Re: What is the case against F#? (2009)

#18
post #11

F# is a lot like OCaml. But OCaml still struggles with multiprocessing, while F# can run on the .NET infrastructure which has this solved.

OCaml is still pretty fast and part of RHEL. How good ia linux support for F#? And how hars is it to get mono installed?

Linux support for .NET in general, and F# in specific, is good. You don't need Mono at all as of .NET Core a couple of years ago (and the situation has only improved going into .NET 5).

Re: What is the case against F#? (2009)

#19
post #10

Most of the time my C# code uses most of the functional paradigms. I write pure functions when i can and use LINQ almost everywhere. Recently i created a F# API with the dotnet CLI, but the syntax is not even close. I get the concepts, but syntax is a little bit to much to just try it when i have to write a new microservice. Am i the only one?

F# syntax is so much better than C# for functional programming - and arguably for object programming too. However, it is sufficiently different that you really need to jump in with both feet. Don't assume it will be easy because you know C#. However, once you start to grok the syntax, you begin to see how the language features elegantly tie together, and the language design decisions make perfect sense. Unfortunately…

I know OCaml and F# are super similar, but how similar is rust syntax?

Re: What is the case against F#? (2009)

#20
GC was probably not a concern in 2009, but these days GC pauses will kill any moderately high throughput app. The stackoverflow blog has lots of content dedicated to the lengths they go to avoid them in C#, such that the resulting C# code doesn't look like idiomatic C# at all.

In F# that would be an even bigger challenge. You could do it, but it would but way ugly. F# is my go-to language for side projects, but for anything server-side that I'm getting paid to work on, I'd be reluctant to suggest F# as a starting point, as much as I'd like to.

Post reply on HN