Blog Moved to http://podwysocki.codebetter.com/

Blog Moved to http://podwysocki.codebetter.com/
posts - 277 , comments - 156 , trackbacks - 27

My Adventures in F#

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:

Sites
Downloads
Articles
Podcasts
Blogs
Books
Conclusion

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 DotNetKicks.com

Print | posted on Friday, January 18, 2008 5:43 PM | Filed Under [ F# ]

Feedback

Gravatar

# re: My Adventures in F#

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!):

http://www.ffconsultancy.com/products/fsharp_for_scientists/

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

Cheers,
Jon Harrop.
1/18/2008 9:52 PM | Jon Harrop
Gravatar

# re: My Adventures in F#

Sorry about that Jon, and it has been corrected. Looking forward to the book!
1/19/2008 12:48 AM | Matthew Podwysocki
Gravatar

# re: My Adventures in F#

Hi,
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.
http://www.codeplex.com/fsmpitools
Cheers
4/17/2008 6:41 PM | Can Erten
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: