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#.
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
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.
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!