F#
An open-source language that makes it easy to write succinct, robust, and performant code.
Supported on Windows, Linux, and macOS
// 'name' is inferred to be a string based on usage.let printMessage name = printfn $"Hello there, {name}!"// 'names' is inferred to be a sequence of strings.let printNames names = for name in names do printMessage namelet names = [ "Ana"; "Felipe"; "Emillia" ]printNames names
let square x = x * xlet isOdd x = x % 2<> 0let sumOfOddSquares nums = nums |> List.filter isOdd |> List.sumBy squarelet numbers = [1; 2; 3; 4; 5]let sum = sumOfOddSquares numbersprintfn "The sum of the odd squares in %A is %d" numbers sum
type Shape = | Square of side: double | Rectangle of width: double * length: doublelet getArea shape = match shape with | Square side -> side * side | Rectangle (width, length) -> width * lengthlet square = Square 2.0printfn $"The area of the square is {getArea square}"
type Customer(firstName, middleInitial, lastName) = member this.FirstName = firstName member this.MiddleInitial = middleInitial member this.LastName = lastName member this.SayFullName() = $"{this.FirstName} {this.MiddleInitial} {this.LastName}"let customer = Customer("Emillia", "C", "Miller")printfn $"Hello, I'm {customer.SayFullName()}!"
Succinct, robust and performant
F# has a lightweight syntax that requires very little code to build software. It's backed by a powerful type system, convenient standard library, and .NET runtime that you can trust to build mission-critical software that is correct, fast, and reliable.
F# for Data Science and ML
F# is used in a variety of ways from building minimal web APIs to performing data manipulation, interactive programming, data science, and machine learning.
F#'s type system and unique features such asType Providers andUnits of Measure are a great fit for data science and machine learning.
Professional tooling, everywhere
High quality editors for Windows, Linux, and macOS all run on a single F# compiler, providing consistent high quality features.
Microsoft + Community
F# is an open source language and Microsoft is a leading contributor. The independent F# Software Foundation provides a central place for the F# community to grow and learn together.
Runs on .NET
F# is part of the .NET developer platform. Use your skills, code, and favorite libraries to build all types of apps.
Ready to get started?
Our step-by-step tutorial will help you get F# running on your computer.