PDA

View Full Version : F#



ed
10-19-2007, 05:59 AM
This week Microsoft gave the indication that F# will be promoted to a status that lets it become a true first class .NET language. (see Somasegar's WebLog (http://blogs.msdn.com/somasegar/archive/2007/10/17/f-a-functional-programming-language.aspx))

There's a lot of interesting stuff in F# and I've personally been keeping an eye on it for quite a while now. If there's anyone out there using IMSL with F#, please drop us a line and let us know how it's going! It's quite easy to call the IMSL C# Library from F# of course, but I haven't worked with F# enough to know if our C# API feels natural or not. I also wonder how pure C# performance for math algorithms stacks up against pure F#, and what's different at the MSIL level.

jdh30
05-30-2008, 01:58 PM
This week Microsoft gave the indication that F# will be promoted to a status that lets it become a true first class .NET language. (see Somasegar's WebLog (http://blogs.msdn.com/somasegar/archive/2007/10/17/f-a-functional-programming-language.aspx))

There's a lot of interesting stuff in F# and I've personally been keeping an eye on it for quite a while now. If there's anyone out there using IMSL with F#, please drop us a line and let us know how it's going! It's quite easy to call the IMSL C# Library from F# of course, but I haven't worked with F# enough to know if our C# API feels natural or not. I also wonder how pure C# performance for math algorithms stacks up against pure F#, and what's different at the MSIL level.

Hi Ed,

F# is currently scheduled for a CTP release soon and a first full release by the end of this year. The IMSL C# libraries work beautifully with F#. The F#.NET Journal (http://ffconsultancy.com/products/fsharp_journal/?vn) has published two articles covering the use of the IMSL C# library from F#.

In terms of raw performance, F# and C# are similar. C# currently does some more intelligent optimizations (e.g. on structs) but F# provides more powerful forms of abstraction and is more actively developed. In particular, F# allows higher-order functions to be inlined which makes it possible to aggressively factor a wide variety of numerical algorithms whilst keeping them generic over data structure without any performance loss. That technique was covered in another recent F#.NET Journal article, as was a complete translation of the famous SciMark2 benchmark where the F# outperforms the original C# in every test whilst requiring only a fraction as much code.

Cheers,
Jon Harrop.