Monday, 19 April 2010

Visual F# 2010 key binding cheat sheet

Download your copy of Microsoft's official F# key bindings cheat sheet here.

"by moving to F# we reduced code size by nearly 75 percent"

Grange Insurance of Columbus OH recently published a compelling case study regarding their use of Microsoft's new Visual F# 2010 programming language.

They cite clarity as a major advantage of F#:

"We liked that Visual F# is tailored to highly mathematical problems, helping programmers work more closely to the problem domain and enabling actuaries and other nonprogrammers to review the code as they would a math formula,"

and parallelism:

"We liked the .NET Parallel Extensions available through F# for managing parallelism automatically through the runtime system."

and integrated development environment and interoperability with existing technologies:

"We also liked that Visual F# is an integrated part of the Visual Studio tool set and the .NET Framework. That meant our programmers could use the same IDE and powerful .NET libraries they knew from having developed the earlier version of the solution in Visual C#."

For other F# success stories, read the freely available first article from The F#.NET Journal.

Visual F# 2010 for Technical Computing

Following the ground-breaking product release of Visual F# by Microsoft as part of Visual Studio 2010, we have updated our F# for Technical Computing book to cover both F# 2.0 and .NET 4.

Visual F# 2010 for Technical Computing includes a variety of changes throughout the book, some affecting changes to the language and others affecting the use of libraries. The three most prominent changes are:

  • Chapter 10: Concurrent Programming now covers the final production-quality implementation of asynchronous workflows in the F# 2.0 language.

  • Chapter 11: Parallel Programming now replaces the TPL CTP with the constructs for shared-memory parallelism that have been integrated into .NET 4. Both the API and the performance characteristics have changed considerably.

  • Chapter 12: Performance has been completely revamped due to massive improvements in the F# compiler and the new garbage collector in .NET 4.

One particular surprise was the substantial difference in performance characteristics between Visual Studio 2010 and the F# prereleases. Several of the benchmarks covered in the book show 400% changes!

kick it on DotNetKicks.com

Thursday, 15 April 2010

The A* algorithm

The F#.NET Journal just published an article about route finding:

"The A* algorithm is often used for route finding in game AI and is a generalization of Dijkstra's shortest-path algorithm from graph theory. This article describes two generic implementations of the A* algorithm written in F#. The first implementation is a simple prototype written in a purely functional style using data structures provided by F#. The second implementation uses mutable .NET collections to perform the same computation substantially more quickly. Finally, an example application is provided that finds a route across the Grand Canyon..."

To read this article and more, subscribe to The F#.NET Journal today!

Wednesday, 14 April 2010

Visual Studio 2010 with F# out now!

MSDN subscribers can now download Visual Studio 2010 that provides the first fully-supported product release of the new F# programming language. Don Syme, the creator of F# at Microsoft Research Cambridge, posted an emotional blog article accompanying this release as it represents the culmination of 7 years of work.

We shall be updating all of our F#-related products to work with the new product release and, in particular, our F# for Numerics and F# for Visualization software libraries will now see their first product releases as well. Future articles in the F#.NET Journal will cover every aspect of Visual Studio 2010 in detail.

Note that there is no Visual F# Express edition and, at the time of writing, there is no user-friendly way to develop F# on .NET 4 for free. However, you can develop F# 2.0 on .NET 3 using Visual Studio 2008 or compile F# 2.0 for .NET 4 using the command-line compilers. Brian McNamara of the F# team has encouraged anyone wanting Visual F# Express to upvote this motion. Hopefully we will see another Visual Studio 2010 Shell with separate F# release that makes it easy to develop F# software with the latest libraries for free. The F# team are also committed to open source cross-platform development, to the extent that they are hiring a new contractor specifically to help with this.

Sunday, 11 April 2010

Book review: F# for Scientists

Our 2006 book F# for Scientists has received its ninth review on Amazon and, like all previous reviews, was given the maximum 5-star rating!

Andre M. Van Meulebrouck from California writes:

A hallmark of this book is conciseness. (The book itself is fairly small and thin; and nicely hardbound.)

This book is a gold mine of great information that could take years to fully digest!

While the book is titled as a scientific book, and it is that; it also has much more to offer. It should be of great interest to scientists, mathematicians, statisticians, computer scientists, financial programmers, and any programmers who want to write good code. It features a well balanced selection of topics including: algorithms, data structures, visualization, graphics, threading, performance, and optimization. The use of DirectX is demonstrated. Some compilation techniques are also shown.

A nice selection of recursive list algorithms are presented that showcase the kind of problem solving that can be done purely with recursion and list processing. These are classic idioms that are good to be exposed to; like power set, and substitution with replacement.

Many of the examples are very much in the spirit of the Scheme Revised Reports, wherein the most gutted possible examples are used to demonstrate a given primitive or concept. Nothing extraneous to cause distractions.

There is a complement to this book called "F# for Technical Computing" that can be purchased from Flying Frog Consultancy. The complementary book adds nicely to the material in "F# for Scientists"; with discussions on such topics as parallel computing and WPF. In addition, the complementary book features longer page sizes, a stay flat (music book style) binding, and color; all of which I really like. (I wish more technical books made use of color because code is much easier to read when you see comments in one color, keywords in another, etc..)

Both books are gems. There are also counterparts to these books for OCaml programmers.

Relevant software can also be obtained from the Flying Frog Consultancy (which has, as part of its logo: "Putting the fun in functional since 2005").

Saturday, 3 April 2010

An e-mail client in F#

The F#.NET Journal just published an article about the design and implementation of a complete GUI application:

"An e-mail client is an application that checks a remote mailbox for incoming messages and allows the user to send newly composed messages and replies to received messages. Incoming e-mails are typically read using the Post Office Protocol version 3 (POP3) which is a simple plain-text protocol implemented over TCP sockets. Outgoing e-mails are sent using the Simple Message Transfer Protocol (SMTP), an implementation of which is provided by the .NET framework. This article describes the design and implementation of an e-mail client that can be used for basic e-mail handling but, in particular, is easily programmed to perform tasks such as transaction processing automatically..."

To read this article and more, subscribe to The F#.NET Journal today!