Geeks With Blogs
Blog Moved to Blog Moved to
Update: Added new Hanselminutes show on F# and other links

With the new year comes new challenges.  Recently I've been looking to take my background in statistics and get back into graduate school.  With those days brought the days of functional programming, pattern matching and all sorts of things.  So, with that, I began to look at F#.

Why F#?

No, it's not because it's shiny and new and everyone's talking about it.  To a point, it made me more aware, but I won't just hop on the next best thing without a real reason for learning it.  Bettering myself sometimes isn't reason enough because when I learn something, I want to naturally go deep, and not just gain a superficial knowledge of it.  I'll cover more about my philosophy in a later post.

To me, F# a natural fit for a lot of things in my background.  As stated before, I have a bit of simulation and number crunching in my background as part of my college life. 

But, also, I've been into High Performance Computing with both MPI (MPICH2) and OpenMP.  But, I was tiredof having to program in C or Fortan as it's not my favorite and it's like stepping back in time if I need to do something complex.  I've even go as far as to wrap the Microsoft MPI API just so that I could program .NET application on Windows Compute Cluster.  That was actually quite fun as I was able to calculate PI and some prime numbers with my .NET libraries.  What I wanted with that was a mirror of the BOOST MPI libraries and I got it going pretty well, even with generics.

Another motivator of mine to learn F# is that functional languages such as this are perfect for creating Domain Specific Languages (DSLs) and other languages.  This could have easily helped in some of my past projects which have included finance and health care.  Such as scenario is covered in Robert Pickering's F# book which will appear below.

Where to Start?

So, naturally many people don't know where to start with their F# knowledge.  Before you begin, you should understand that F# doesn't operate on Object Oriented principles like many are used to.  Instead, it operates on Functional Programming Principles.  If you're familiar with Haskell, Lisp and Erlang, you should be pretty familiar with the concepts.  In case you aren't, here are the basic concepts:
  • Avoids state and mutable data
    Emphasizes the use of functions with no state

  • High-order Functions
    Functions are high-order when they can take functions as parameters and return functions.

  • Pure Functions
    Functions are pure functions when they have no side-effects, meaning it accepts no input, produces no output and no external devices accessed.  Can operate in parallel quite freely

  • Recursion
    Although we know it from the OO world, it really shines in the Functional Programming space.  Recursion allows the function to call itself to be called over and over.
F# Links

I have compiled a pretty comprehensive list that allowed me to learn F# in a relatively short amount of time.  Then again, I've dealt with functional programming before, so there was minimal learning curve. 

So, let's get started with the links:


I hope this gives you a good foundation of what you can do with F# and what it's really good at.  Will it replace your C# applications, no, that's not its mission in life.  But, if you have the need for DSLs or generally interested in higher power calculations, grid computing, recursion, etc, then F# is the place for you.  Did I miss anything?  In the coming weeks, I'll start diving into more of F# goodness, showing the basics and getting some things going.  Until next time, develop, mentor and inspire!

kick it on Posted on Friday, January 18, 2008 5:43 PM F# | Back to top

Comments on this post: My Adventures in F#

# re: My Adventures in F#
Requesting Gravatar...
You spelled my name wrong! :-)

Thanks for mentioning my new book "F# for Scientists". I just completed the book this evening. So I hope it will be out long before May!

You might also like to refer to the home page of the book rather than the Amazon page (Amazon have no idea what I'm up to!):

In particular, that page will have all of the source code from the book available for free as Visual Studio projects.

Jon Harrop.
Left by Jon Harrop on Jan 18, 2008 9:52 PM

# re: My Adventures in F#
Requesting Gravatar...
Sorry about that Jon, and it has been corrected. Looking forward to the book!
Left by Matthew Podwysocki on Jan 19, 2008 12:48 AM

# re: My Adventures in F#
Requesting Gravatar...
I just stumbled upon to your post. If you haven't seen so far. you could check an MPI wrapping for MPICH using F# on codeplex.
Left by Can Erten on Apr 17, 2008 6:41 PM

Your comment:
 (will show your gravatar)

Copyright © Matthew Podwysocki | Powered by: