Top
Best
New

Posted by bozhidar 4/1/2025

Why F#?(batsov.com)
447 points | 413 commentspage 5
jxjnskkzxxhx 4/1/2025|
Does anyone else find interesting that people who write blog posts saying "my favourite language is X", it's never a mainstream language..?
mrkeen 4/1/2025||
Successful language designers select for what's popular, not what's good.

C++ intersected the mass of C programmers with the new OO fad, and kept all of C's warts. Had Stroustrup made C++ better, he wouldn't have an army of adopters who already knew C. Maybe merit will win out in the long run [1]? I'm not hopeful.

Java needed to be close enough to C++, and C# to Java. And Brendan Eich joined Netscape to "put Scheme in the browser".

[1] https://www.theregister.com/2025/03/02/c_creator_calls_for_a...

pantsforbirds 4/1/2025|||
My favorite language is Python, but I wouldn't write a blog post about it because no one would care.
jxjnskkzxxhx 4/1/2025||
My favourite language is also python, and I would love to read your blog post on why your favourite language is python :-)
siknad 4/1/2025|||
New mainstream languages are rarer than new better (in some way that can be favorable) languages.
iLemming 4/2/2025||
> people who write blog posts ... never a mainstream language

Don't you find it amusing that food critics usually write about little-known or new restaurants and never do any fast-food chain reviewing?

sklivvz1971 4/1/2025||
As a person who's worked with the author (a great guy!) and with the F# community on a very large F# project: don't bother with F#, professionally speaking.

F# has many theoretical qualities, which make it fun if you like these things, but it also has some fundamental flaws, which is why it's not getting a wide professional adoption.

- the build system was a mess last I checked (slow, peculiar)

- syntax is not c-like or python-like (a big deal for a lot of people)

- you can't hire developers who know it (and certainly the few are not cheap)

- the community is a bit weird/obsessed/evangelizing (a turn off in a professional environment)

- it's clearly a second class citizen in the .net world (when stuff breaks, good luck getting support)

On the other hand

- it has discriminated unions

- units

- etc.

but do you need this stuff (not want: need)? most people don't.

debugnik 4/2/2025|
The build system is exactly the same as C#, MSBuild with its .NET SDK, and syntax and community are entirely subjective; F# has the least weirdo community I've personally seen for an FP language. Weak arguments to say the least.

I'll give you the chicken-and-egg hiring problem and it being second-class to the .NET team, though; I'd add poor IDE support by modern standards, only Rider feels right. I love F# but I've moved on for these reasons.

pdimitar 4/1/2025||
People will do anything except actually try Elixir. :D

...I mean: pipes, immutability, transparent mega-parallelism... helloooo?

I tried F# some years ago (after I was fired from a shop that decided they will go all-in on Java and F# and dropping everything else overnight) and I was not impressed. I mean the language is really nice but the C# baggage and runtime was just a bit much. And I was not left convinced that immutability alone is worth the switch. I suppose we can call F# an FP gateway drug?

Now arguably you get a runtime and some baggage from the Erlang runtime (the BEAM VM, where Elixir also runs), but the guarantees and features you get are invaluable, and have proven themselves many times over the last literal three decades.

xigoi 4/1/2025||
Elixir is dynamically typed, which presumably many people are put off by.
pdimitar 4/1/2025||
Yes, I agree that it's a big drawback.

Elixir made me more productive and gave me back my love for programming, and I work with it professionally for 9 years now. But the lack of static typing is getting so irritating that I started upping my efforts to get [even] better at Rust lately.

So I agree. It's one of the very top drawbacks of Elixir.

weakfish 4/1/2025|||
The shop went all in on Java and F#? Why not C# and F#? That’s really odd, unless there’s context I’m missing.
pdimitar 4/1/2025||
I wish they told me. They cut ties with most of their previous devs overnight, as if we were some enemies. Weirdest firing in my life and career to this day.
weakfish 4/1/2025||
That’s truly bizarre. Glad you’re out of that situation, doesn’t sound quite healthy from what you’re saying.
johnnyjeans 4/1/2025|||
> Elixir

For me, it's Erlang. I just really like its horn clause syntax, it's so clean and readable. I know a common complaint is lack of piping (and even though you can implement it trivially, the order of arguments for some functions makes it of dubious use) but it's a small price to pay.

> I mean the language is really nice but the C# baggage and runtime was just a bit much

This was my experience with F#. Frankly, I've never been happy with my experience with CLI on Linux, and the toolchain inherits a lot of baggage from its C# heritage. Microsoft's toolchains have a very distinct workflow to them. F# has some interesting aspects to it like active patterns (something I wish was more common in the ML-family), but tbh I'm more than happy with ocaml.

innocentoldguy 4/1/2025||
I can't remember which version of Erlang was the most current when I started learning Elixir, but I do know that it was years before OTP 20, which fixed its string issues. Prior to that, Erlang didn't have very good string support for internationalization (I do a lot of Japanese language programming). Elixir, on the other hand, did. Otherwise, I may have gone with Erlang back then.

I like Erlang a lot, too. Both are great languages.

BiteCode_dev 4/1/2025||
If one need to get on Beam, is it better to start on Elixir or Gleam?
pdimitar 4/1/2025||
Elixir's ecosystem is much farther ahead than Gleam, so if you want to actually achieve stuff without pauses to fill the gaps yourself, then Elixir is the way to go.

And don't get me wrong, I love the idea of Gleam, a lot (Rust syntax, strong static typing, what's not to love?). But my PL early adopter days are over.

this_user 4/1/2025||
Because you love using Microsoft's shitty technologies, but also want to be completely unemployable?
pacoWebConsult 4/1/2025||
It's pretty baseless to claim that modern dotnet is inherently shitty. They've made tremendous strides in the dotnet core era.

F# making you unemployable is debateable, but I don't see what makes F# any less employable than most other FP languages. They have some niche applications that make it useful rarely, but when they're useful its a terrific tool for the job. F#'s ability to interop with the rest of the dotnet ecosystem positions it better than most functional languages for business usecases.

zem 4/1/2025|||
I'm sure Microsoft has developed a lot of bad tech, but by and large their languages have been great. msvc c++ compiler as a possible exception, but f# in particular is excellent.
gwbas1c 4/1/2025|||
I've spent my entire career, 22 years, primarily in C#.

I'm quite employable.

wiseowise 4/1/2025||
> Because you love using Microsoft's shitty technologies

If we go by the joke in gp, this is you.

tialaramex 4/1/2025||
I don't have any problem with the idea that Microsoft's technologies are "shitty" after all the response of my work laptop to its mandatory Windows 11 upgrade was a non-copyable diagnostic message with an opaque code in it which, as I understand it, is basically the equivalent of "Huh, oops, maybe try again?" and my colleague spent a week trying to uh, share data from a "Sharepoint" table.

But .NET's CLR doesn't seem especially shitty. It's not awesome, I don't feel that RIIR urge when I work with C# and I probably wouldn't with F# either but it's fine, it's like Java again, or maybe Go or Python. It's fine. I don't hate it and that's enough.

nudpiedo 4/1/2025||
Same as many, I had wonderful experience with F# in the past, I would use it again if:

- fable would 100% detach from dotnet - keeps up yo the LLM rush, specially vibe coding on cursor

Last LLM experience it generated obsolete grammar (not much but a bit).

Such la gauges are key for vibe coding experience and modeling.

oguz-ismail 4/1/2025||
>whitespace is significant, like in Python

hard pass

110bpm 4/1/2025||
This isn't such a big issue in my experience. Auto-formatting helps a lot, the code needs to be just syntactically correct.

The default F# autoformatter is bundled/supported by VS Code, VS and Rider [0].

[0]: https://fsprojects.github.io/fantomas/docs/end-users/StyleGu...

int_19h 4/1/2025|||
F# has both "lightweight" (indentation-based) and "verbose" syntax. If you don't like significant whitespace, you can just use the latter.

https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...

sundarurfriend 4/1/2025||
That's an interesting idea and implementation.

I don't think being whitespace-significant is a "hard pass" dealbreaker, but as someone who's not a fan of it, I'd say this only goes a small way towards alleviating that - like most "choose your preferred syntax" designs. Even if you're a lone-wolf developer, you're gonna end up reading a lot of example code and other material that's in the ugly whitespace-sensitive style, given that:

> The verbose syntax is not as commonly used ... The default syntax is the lightweight syntax.

And most people in practice are not lone-wolf devs, and so the existence of this syntax helps them even less.

voidUpdate 4/1/2025|||
I was with it until I heard no braces :/
pjc50 4/1/2025|||
I have some good news for you about C#.
voidUpdate 4/1/2025|||
I love C#, its a great language
ahoka 4/1/2025||
Perfect for blub programmers!
BeetleB 4/1/2025|||
C# doesn't require braces...?
lunarlull 4/1/2025|||
You never touch python code either?
oguz-ismail 4/2/2025||
not since they binned 2.7
fire_lake 4/1/2025||
Static typing removes the downside of whitespace.

Oh, and every language with line comments (so most of them) has significant whitespace.

AnimalMuppet 4/1/2025||
> Static typing removes the downside of whitespace.

How so?

> Oh, and every language with line comments (so most of them) has significant whitespace.

Technically true, but that's not what people mean by "significant whitespace" in this context. So you're being pedantic rather than saying anything meaningful.

But you made me think. The ultimate nightmare would be significant trailing whitespace - the spaces and/or tabs after all the visible characters change the meaning of the line.

Akronymus 4/2/2025|||
In f#'s case, there is the trifecta of everything being an expression, static typing and default immutability. This means you often write code like this:

let foo = if bar then baz else someDefault

Due to it being an expression you assign what the if evaluates to to foo. Due to static typing, the compiler checks that both branches return the same type. Due to the default immutability you don't declare and assign in separate steps. What this results in, is that accidentally using the wrong indentation for something usually results in an error at compile time, at the latest.

Compared to how python does significant whitespace is that it's dynamic typing + statement based, which means you can easily end up assigning different types to the same variable in different branches of an if, for example.

I hope I explained it in understandable terms

fire_lake 4/2/2025||
Pythons approach to variable declarations makes this doubly bad.
Akronymus 4/2/2025||
Tbh, I've been successful enough in avoiding using python that I don't know the specifics of that.
fire_lake 4/1/2025|||
> How so?

Well I don’t know what issue you have with whitespace, but the usual complaint is that programs with small typos are syntactically valid but logically incorrect. This is why CoffeeScript became so disliked. A static type checker makes this scenario much less likely since it won’t compile.

I would also add that F# has some indentation rules (“offside rules”) and tabs are disallowed, further shrinking the input space.

fnord77 4/1/2025||
> Trivia: F# is the language that made the pipeline operator (|>) popular.

laughs in clojure

dev_l1x_be 4/2/2025||
[dead]
867-5309 4/1/2025|
[flagged]