Skip to content
Hello, F#
step 1/5

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:

  • %s for strings
  • %d for ints
  • %f for floats
  • %A for any type (uses F#'s smart pretty-printer)
  • \n already implied by printfn (the n)
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…