why use F# for scripting and automation?

19 points by kryptiskt


pyj

As much as I enjoy using it, it's sad, but I have much less confidence anyone on a random team would be comfortable writing or updating F# code. It's not that hard, it's just another hurdle to get over. This might be the one case where "Nobody Ever Got Fired For Buying Microsoft" isn't true, as bringing in F# scripts is a lot more wild than just using Python, especially with recent uncertainty about Microsoft.

However, LLMs have provided a huge boon to dealing with weird things in the language.

if something broke, you get a red squiggly line as feedback

it points to where it broke immediately

Compile time feedback before running is a big reason I've tried multiple times to use F# as a scripting replacement. When it works, it's great, but Python tooling is much more consistent overall. As of a week or so ago, an .fsx (F# script) file in Rider didn't do this for me, while working well for the .fs program right next to it. When the tooling works, it's great and feels like a lite, batteries included, GC'd Rust. When it doesn't, I question why I didn't just use Python in the first place.

the script contains all the code you need to run it, including dependencies and versions

I can see this being a headache for IT/security, though I haven't used F# scripting in a professional setting enough to know if there are mitigations.

F# runs on .NET, which means you have access to a massive ecosystem of libraries and tools

This puts F# in the same category as Python and Go for tooling in terms of "What batteries are included."