F#
A functional-first language in the ML family, running on the .NET platform.
27 steps across 1 tours, from the basics to complete programs.
The tours
- First released
- 2005
- Created by
- Don Syme at Microsoft Research
- Typing
- Static, inferred nearly everywhere; immutable until you say otherwise
- Snippets target
- F# 10
- File extensions
- .fs, .fsx, .fsi
What it is for
F# is the functional-first language of the .NET family: OCaml's lineage — let bindings, pattern matching, discriminated unions, currying — compiled to the CLR, with the entire NuGet ecosystem one open statement away. Finance was its first stronghold (banks and trading shops liked types that make illegal states unrepresentable), and it holds serious ground in data analysis, web backends via Giraffe and the SAFE stack, and anywhere a C# shop wants a sharper modeling tool.
The language's signature moves are about shaping data: records with copy-and-update, unions the compiler forces you to match exhaustively, Option and Result instead of null and exceptions, and the pipeline operator threading transformations left to right. Units of measure — kilograms and jars checked at compile time with zero runtime cost — remain a feature essentially no mainstream rival has shipped.
Its scripting story is quietly excellent: .fsx files run under dotnet fsi with full type checking and NuGet references, making F# a serious alternative to Python for exploratory scripts on .NET-friendly teams. The community is small and unusually senior; the language changes slowly and deliberately, and code from a decade ago mostly still compiles.
Where it came from
Don Syme built F# at Microsoft Research in Cambridge, shipping the first release in 2005 as a research-grade port of OCaml's core to .NET — work that had already forced the CLR to grow generics, a contribution C# programmers benefit from daily. It graduated to a fully supported Visual Studio language with F# 2.0 in 2010.
F# went open source under the F# Software Foundation's stewardship, and the async workflows it shipped in 2007 quietly previewed the async/await pattern that C#, Python, and JavaScript later adopted. Type providers (2012) gave it compile-time schemas for external data sources — another idea ahead of its ecosystem.
When .NET itself went cross-platform and open source, F# came along fully: first-class in the dotnet CLI, releases now tracking the annual .NET cadence. It has settled into the role of .NET's design conscience — a small language whose ideas (records, pattern matching, nullable-reference honesty) keep migrating into its bigger sibling.
What it is like to type
F# types like math notes taken quickly: let and the equals sign open most lines, almost no type annotations survive inference, and whitespace does the structural work braces would. The pipeline |> is the signature keystroke, often opening indented lines in a column, with >> for composition and :: for cons close behind. Match arms line up under vertical bars, printfn formats carry %s and %d, and the module-dot vocabulary — List.map, Option.bind, Seq.take — lands as steady camelCase after capital modules. Low on punctuation, high on rhythm.
27 steps across 1 tours, from the basics to complete programs.
Official documentation
- fsharp.org
- The F# documentation (Microsoft Learn)
- The language reference
- F# for Fun and Profit
- The core library reference