Fun with F# - Life, the solar system and everything (in 101 samples)

It's been said that to keep your dev skills fresh it's good to learn a new programming language every week|month|year. That this broadens your point of view and helps keep your brain active and smelling sweet.

And if you're looking for a language to learn, Visual Studio 2010 shipped with a complete new language in the box, F#. And this isn't your C/C++/Java/C# type language, nor VB, nor dynamic/scripting kind of language. F# is a functional programming language. I'll

Recently a number of F# code samples were posted to the MSDN Code Gallery which reignited my interest in checking it out.

image

The 101 Samples project makes it easy to check out some some of the different things you can do in F#.

image

And of course the app itself is written in F#;

image

Another kind of fun thing to play with is a simple solar system simulation;

This sample simulates the orbits of planets around the sun. The calculations use real data and the units of measure feature in F# allows the compiler to help verify that they are correct.

image

SNAGHTMLc540609-SolarSim
And what's programming without a Game of Life?

This program is an implementation of Conway's Game of Life with a basic UI to allow the user to interact with the simulation. The simulation state calculations are performed on a separate thread from the UI to help keep the UI responsive.

image

Short and simple projects to get you and I started playing with F#. Perfect weekend coding fun... Smiley

Follow the Discussion

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.