Reading — step 1 of 5
Learn
~1 min readFirst Steps
F# was designed in 2005 at Microsoft Research by Don Syme. It's a functional-first language on .NET, heavily inspired by OCaml. Same runtime as C# — they share libraries.
The simplest program:
printfn "Hello, F#!"
That's it. No class, no Main, no namespace. F# scripts allow top-level expressions.
printfn is type-checked at compile time. The format string is parsed:
%sfor strings%dfor ints%ffor floats%Afor any type (uses F#'s smart pretty-printer)\nalready implied byprintfn(then)
printfn "%s is %d years old" "Ada" 36
F# is whitespace-significant. Indentation defines blocks (like Python). No braces, no semicolons.
Discussion
Ask a question, share an insight, or help someone who’s stuck.
Sign in to post a comment or reply.
Loading…