Earlier quoted context omitted.
F# is up to version 9 now, and has only improved over time, IMHO. Type providers are a very small part of the story and can be avoided entirely if you want.
I tried F# when it was first released and was not a fan, but it sounds like that impression is a little outdated. C# has come so far in that time it’s almost a new language. I’ll have to take another look.
Why F#?
161–170 of 424 posts
Re: Why F#?
#162Re: Why F#?
#163Earlier quoted context omitted.
I think Clojure is the better option if you want to do FP using the JVM ecosystem. The problem (for me, anyway) I've run into with Scala is that it supports both functional programming and object-oriented programming. Every code base I've worked on in Scala has ended up being a hodgepodge of both, which I find annoying. However, the best functional programming language is, of course, Elixir. :D
Elixir getting a strong type system is interesting, but watch out for gleam though But they still miss the computation expressions, which open interesting possibilities like https://github.com/CaptnCodr/Fli and https://github.com/fsprojects/FsHttp
- Hot updates.
- Full distributed system support.
– Low-level process manipulation.
- Named processes.
- Advanced supervision strategies.
- Behaviours other than GenServer.
- Type-safe distributed messaging.
- And several other things that I value in BEAM and OTP.
I can't justify trading the full power of BEAM and OTP for static typing. To be fair, though, I've written a lot of code in both statically and dynamically typed languages, and static typing isn't something I value much (to the point that you might say I don't care about it at all :D).
Re: Why F#?
#164Earlier quoted context omitted.
Interesting - I'm curious where your thoughts are now on using FP/Scala in 2025? I've always looked at F# with envy as it is a hosted ML that will have extremely battle tested bindings to the important day to day stuff via C# (Darklang's stories of struggling with postgres and AWS when using OCaml was a good cautionary tale on the risks of using less common langs as a startup) Never had a chance to try out Scala but…
It's never been a better time to try Scala if you're interested in the FP side. It's still very much "not opinionated" but the community and ecosystem have benefited from a certain convergence and given up on the "better Java" front which is served by Kotlin more adequately. Of course you can still consume any Java library when needed but it's best to avoid it if possible. Today you can pick between several ecosystem…
Re: Why F#?
#165Earlier quoted context omitted.
Apache Spark, Delta Lake are written Scala. Being JVM based, it has a large ecosystem. Scala seems like a better choice than F#.
I'm sure it can be the better choice, but for me it was not. It seems there was some incompatibility between me and Scala. I find it such a complex language and I never managed to wrap my head around it. As I said F# was my last choice at the start of my evaluation, and Scala was high on the list due to the Java ecosystem. But in the end it didn't work out for me. F# on the JVM would be great though!
Re: Why F#?
#166Otherwise, I am happy with OCaml, but F# has also a place in this world.
Re: Why F#?
#167Earlier quoted context omitted.
In C#, you can't use the await keyword in a non async method, so I find the argument short sighted.
If your code base is already using async await it's really not an issue.
Re: Why F#?
#168> Why F#? I'm kinda wondering if anyone here with decent C#/.net experience can give their version of the answer? --- The article really didn't answer its own question. It basically says "How" instead of "Why"... ...Which as someone who's spent over 20 years in C#, and tends to advocate for "functional" style, leaves me with more questions than answers!
Pro tip: don't write F# like you would write C# - then you might as well write C#. Take the time to learn the functional primitives.
Re: Why F#?
#169I did try F#, but I was new to .NET ecosystem. For 1 "hello world" I was quite surprised by how many project files and boilerplate was generated by .NET, which put me off. I am all for FP, immutable, and modern languages. But then where are the jobs and which companies care if you write good code? Now everyone wants languages which are easy to use with AI, while reducing workforce and "increased productivity". I have…
I like F#'s syntax when all you're doing is pure logic. But when you have to interface with any IO like a database or REST call or something, you have to abandon the elegance of ML syntax and use these ugly computation blocks. In C# you can do something like this: var post = await _postService.getById(id); in F# the equivalent is basically let getPostById id = async { let! post = blogPostService.getPostById id return…
For the specific case of C# use of await it is unfortunate that C# didn't design this feature with F# interop in mind so it does require extra steps. F# did add the task builder to help with this so the 'await' is replaced with a 'let!' within a task builder block.
let getById(id:int) : Task = failwith "never"
let doWork(post:string) : unit = failwith "never"
let doThing() = task {
let! post = getById(42);
doWork(post); }
Alternatively the task can be converted to a normal F# async with the Async.AwaitTask function. let getPostById1(id:int) : Async = async { return! getById(id) |> Async.AwaitTask }
let getPostById2(id:int) : Async = getById(id) |> Async.AwaitTask
let getPostById3 : int -> Async = getById >> Async.AwaitTaskRe: Why F#?
#170Earlier quoted context omitted.
F# is up to version 9 now, and has only improved over time, IMHO. Type providers are a very small part of the story and can be avoided entirely if you want.
I don't doubt it, but I don't run Microsoft software any more. I've seen enough embrace, extend, and extinguish in my lifetime to not depend on them for my code's execution environment. My current work needs nothing the .NET environment provides that I can't use python's standard libraries to get done, or bash and C if I need to. But I'm lucky to no longer be in a corporate environment, so I don't need to consume com…