Writing high performance F# code
bartoszsypytkowski.com
bartoszsypytkowski.com
The safer route is to install the non-snap-based versions.
(I maintain this tooling, for what it's worth)
Unless you have a reason to only use LTS releases, install .NET 5. I suppose this doc could clarify that 3.1 is an LTS and .NET 5 is a "current" (but newer and better).
- .Net Core 5
- VS Code
- Ionide
There is no place for high order functions and functional constructs in high performance F# code.
This sounds pretty good to me! Not to mention that once you get out of the hot path, the threshold to switch to more readable F# is very low.
It is no different in most languages, even C++ can look pretty ugly when going for F1 performance.
I suppose, though, that it's always easier to throw a baby out with the bathwater when it's someone else's baby.
However, I wish the compiler would more aggressively optimise things so that I can dip into this style less often. I shouldn’t have to write the imperative stuff if the translation is mechanical!
The C++ compilers do far more work for the user, despite F# being a language much more conducive to being optimised.
It would be great if Microsoft Research could sponsor a project in this area.
I learn a lot by reading others' code. Can anyone recommend a a project or two that is small enough for a newcomer to wrap their minds around, that also exemplifies what makes a high quality F# codebase?
Maybe try looking at the demo code for https://safe-stack.github.io/
I wish our online systems were #F Elmish style. Unfortunately they are TypeScript front-end, but F# server side
https://github.com/giraffe-fsharp/Giraffe
As an added bonus you'll learn a very popular tool for sticking a web interface in front of your F# app.
maybe something like suave (backend web framework).
The bigger problem I found going down the F# route is F# libraries go dead. For long term projects, far better not to use any thirdpary F# libraries and just use pretty popular third party .net libs from the C# world or the core .net lib. These days I mostly just use C#. The advantages of F# are not that big compared to just writing C# with a similar coding mindset.
I know F# can tap into the C# ecosystem but you have the mental burden of translating every example and documentation from C# to F#. In Clojure land these is pretty bad, you have to spend a lot of time understanding these extreme over-engineered over-abstracted Java libs before you can begin to use them.
It also helps that C# has had some functional building blocks longer than Java had, which means more of the ecosystem has at least some support for passing around functions and the likes.
This great little language needs a little more love, IMHO
record Book(string Name, int publishYear)
and there are millions of jobs worldwide.
I find it a positive sign that these expressive languages are mimicking one another.
That's more an observation I've seen on the ground in previous roles but YMMV.
Many UK (City area) and Swiss banks use it for data analysis.