146

How do I go about getting into F# programming?

What are some good starter samples to learn the language, or learn about some of its advantages over other languages?

What tools do I need (e.g. Windows, Visual Studio, ...)?

Brian
  • 117,631
  • 17
  • 236
  • 300
  • 5
    With 120 up votes should this question be reopened? It provides good answers to a good question that has been read many many times. – rollsch Feb 03 '17 at 21:17

3 Answers3

142

Official entry point is here: Microsoft F# Developer Center

For a quick taste, consider trying F# in your browser (Silverlight). (contains interactive tutorial walkthroughs)

Start by watching videos and presentations (BTW, An Introduction to Microsoft F# by Luca Bolognese is still one of the best presentations on the subject). Then read the following two must-read books:

and in addition to that...

Quick Links

Community

Q&A

Blogging/publishing

Meetup Groups

Videos

Other Books

Tools needed

Visual Studio:

  • F# is built in to professional editions of VS2010 and VS2012.
  • F# is available as a add-on component to Visual Studio 2012 Express for Web.
  • Alternatively you can also install the VS2010 integrated shell (free download). Then install the CTP MSI, for a free VS2010 version of F# 2.0.

MonoDevelop:

  • You can find lots of information about using F# within MonoDevelop here. The F# compiler and fsi.exe are now part of the Mono distribution.
Cœur
  • 37,241
  • 25
  • 195
  • 267
Brian
  • 117,631
  • 17
  • 236
  • 300
  • 1
    I have yet to encounter a "must-read" book when it comes to programming, hence i am rather sceptical of such book recommendations... – H.B. Aug 16 '12 at 02:02
  • 3
    What if this was added into the tag info? http://stackoverflow.com/tags/f%23/info – Be Brave Be Like Ukraine Aug 17 '12 at 16:49
  • 2
    If it can help, **I** and myself, found that I use different books for different purposes. Expert F# more as a reference (not a pure reference though) to lookup things, beginning F# as a culture book where I **always** learn something very useful no matter which chapter I read, even basic stuff, and RWFP as a wrapping up on a subject. – nicolas Aug 22 '12 at 18:18
  • 3
    I quite highly recommend Jon Harrop's book too. Really to the point, on the algo side with nice fundamental stuff. 0% waste. Also Jon likes noobie. – nicolas Aug 22 '12 at 18:19
  • 1
    @H.B. I think there are must read, but those are not fundamental and general enough to qualify IMHO – nicolas Aug 22 '12 at 18:21
  • @nicolas: For .NET techs i only consider the hard documentation and introductory articles on MSDN a must read, but those are not books obviously. – H.B. Aug 22 '12 at 21:27
  • IMO Chris Smith's book is good if you know functional programming concepts already and just need to learn how to apply them to f#. – Terrance Apr 17 '13 at 11:11
  • awesome post. this should be in the tag wiki :) – Alexander Oh Jan 07 '17 at 23:01
33

The way I learned F# was to go through the following 3 steps.

First, I went through the introduction on the Try F# website which gives a good (but light) interactive introduction to the syntax and style of the language.

Next, to get a feel for actually solving problems in the language, I began solving some of the puzzles on the Project Euler site. I solved about the first ten problems and after each successful problem, I looked up an alternative F# implementation here. This gave a good feeling for how to work with sequences and using recursion and just generally becoming comfortable with the syntax.

Finally, I read the truly excellent 30-point guide Why use F# on http://fsharpforfunandprofit.com/. It takes you step-by-step through all of the major parts of the language describing how you can take advantage of them - with an eye towards C# developers. After that I encourage you to look around for other resources on the website, they are all very well written and highly insightful.

After completing these steps you should be ready to begin creating a real project in F#.

Morten Christiansen
  • 19,002
  • 22
  • 69
  • 94
  • 3
    I really like the Euler recommendation. Actual problem solving is (to me) the best way to really dig in. Also fsharpforfunandprofit is a great source i found really helpful too. – Ostkontentitan Nov 13 '14 at 08:35
  • On the euler project example solutions for f# doesn't seem to be the most performant. Problem one performs a lot better with: let problem1 = [1..999] |> List.filter (fun x -> (x % 5 = 0 || x % 3 = 0)) |> Seq.sum;; I'd suggest measuring time of your solution and the provided ones. http://stackoverflow.com/questions/4528355/measure-time-of-execution-in-f – Ostkontentitan Nov 13 '14 at 10:12
  • I did the same. Learned a bit of language/syntax/way of thinking and went to Project Euler. – Grzegorz Gierlik Feb 24 '15 at 17:08
25

Brian already put together a great list, but I humbly submit my own small contribution to the rich ecosystem of F# learning material, the F# Koans- a simple, fun, and interactive way to learn the F# language through testing.

Chris Marinos
  • 965
  • 8
  • 8
  • 2
    +1 This is a great interactive introduction to the basic concepts, looking forward to some advanced level koans. – 79E09796 Aug 20 '12 at 09:55
  • 1
    Thank you. I learned a ton from the koans, and i would totally be interested in some advanced level ones. – Tyler Smith Oct 18 '12 at 15:19