Dan on eScience & Technical Computing @ Microsoft

eScience & Technical Computing - Web Services and Scientific Research

F# – Sept CTP available and units of measure checking/inference

F# – Sept CTP available and units of measure checking/inference

  • Comments 1

clip_image001The September 2008 CTP of F# is now available for download.  F# is a functional programming language for the .NET Framework and really should be looked at by scientists/researchers.  Also check out the F# Developer Center on MSDN for more info and resources. 

There are a lot of new features in this release – here’s a sampling:

  • Broadly improved Visual Studio 2008 integration, which allows F# users to scale from scripting and explorative development, up to large-scale component and application design, all within Visual Studio.
  • Improvements to the F# language and libraries to make them simpler and more regular.
  • An exciting new language feature, Units of Measure, which extends F#’s inference and strong typing to floating point data.

The Units of Measure checking and interference feature is very exciting feature and potentially most scientifically revolutionary programming language features around - scientists and engineers to check out.  This is because the F# compiler knows the rules of units

When values of floating-point type are multiplied, the units are multiplied too; when they are divided, the units are divided too, and when taking square roots, the same is done to the units. So by the rule for multiplication, the expression inside sqrt above must have units m^2/s^2, and therefore the units of speedOfImpact must be m/s.

Take a look at the SolarSystem sample -  A Solar System simulation application, taking advantage of Units of Measure in F# to do physics simulation.  Andrew Kennedy, who researched, architected and implemented this feature has all the details.

Other F# resources:F# for Scientists

Microsoft F# Developer Center

Leave a Comment
  • Please add 8 and 2 and type the answer here:
  • Post