Welcome to Atalasoft Community Sign in | Join | Help

Between Atalasoft, Professional F# 2.0 and the MVP Summit I’ve been completely swamped and ended up with quite a backlog of posts.  Between the Brian-Chris F# Code Battle, Luca’s LChart, Ashley’s continuing FScheme series and Matthew’s MongoDB stuff I’m not sure I can pick a favorite.  That’s not true, I’d go right for the DAWG-fight series.  The arcane secrets of F# optimization await inside.

 

C9 Lectures: Dr. Don Syme - Introduction to F#, 3 of 3

In Part 3 of this 3-part lecture series, Dr. Don Syme elaborates further on: Patterns, Object Basics, [and] Imperative Programming.

 

Dr. Don Syme’s Async and Parallel Design Patterns in F#: Agents

In part 3 of this series, we explore lightweight, reactive agents in F# and look at some typical design patterns associated with these agents, including isolated internal state.

 

Chris Smith’s DAWG-fight, Optimizing text search in F# II and Dr. Brian McNamara’s DAWG-Gone (F# Language Team Code Battle Summary)

So today I’ll walk you through what Chris did right (shortest… subsection… ever!), as well as what he did wrong (get comfy in your chair), and then show my own implementation. 

 

Luca Bolognese’s LChart: Displaying Charts in F# Parts One, Two and Three

I want to use F# as a exploratory data analysis language (like R). But I don’t know how to get the same nice graphic capabilities. So I decided to create them. Here is a library to draw charts in F#.

 

Dr. Brian McNamara’s An RSS Dashboard in F# Parts Four, Five and Six.

You can see from the colors in the screenshot from part one what I desired, but this requires knowing which links are ‘visited’ and which are not, so I can color each link appropriately.  It turns out, this information can be had via unusual means…

 

Ashley Feniello’s FScheme Parts Ten and Eleven

We’re now taking the first small step into the world of nondeterministic logic programming (chapter 16 of Bill Hails’ book). Hopefully you enjoyed the last post about continuation passing and found the idea to be ripe with potential power; indeed so powerful that we’re going to use it now to bifurcate the universe! No really, we are…

 

Luca Bolognese’s A simpler F# MailboxProcessor

I always forget the pattern to use to create a functioning MailboxProcessor in F#. I mean, which piece has to be async and how to structure the recursive loop. When I find myself in that kind of a situation situation, my instincts scream at me: “Wrap it and make it work how your mind expects it to work”. So here is a simplification of the paradigm.

 

Matthew Podwysocki’s The F# PowerPack Released on CodePlex

As announced yesterday, the new February 2010 release of F# is out. This release is much more of a stabilization release instead of adding a lot of features including improvements in tooling, the project system and so on.

 

Matthew Podwysocki’s Exploring MongoDB with F#

I just want a quick answer with the data I have.  There was one issue of course that nagged me which was the ubiquitous use of strings for everything from databases, collections, and keys.  With a language such as F#, could we do any better than this approach?

 

Matthew Podwysocki’s F# and the Dynamic Lookup Operator ala C#

In the F# language, we have the ability to define two “dynamic” operators, a get member operator denoted by the ( ? ), and the set member operator denoted by the ( ?<- ).  The F# language and its associated libraries do not have an actual implementation of these operators, but instead allow you to implement them as you see fit.

 

Steve Gilham’s Updating F# posts to 1.9.9.9 Parts One and Two

Possibly a few more issues will come out as I reconstitute my analysis tool, which is currently undergoing a retooling of its build system to automate some of the manual checks for whether the operational tests succeeded or not.

 

Steffen Forkmann’s FAKE – F# Make 0.29 Released

Last week I released version 0.29 of my build automation tool “FAKE – F# Make”. The new version comes along with a couple of changes which I will now describe.

 

Luis Diego Fallas’s Using a Webcam with DirectShowNET and F#

In this post I'm going to show a small F# example of using DirectShowNET to access a webcam and manipulate the image data.

 

Mark Needham’s F#: Passing an argument to a member constraint

I've written previously about function overloading in F# and my struggles working out how to do it and last week I came across the concept of inline functions and statically resolved parameters as a potential way to solve that problem.

 

Julien Ortin’s BitTorrent Bencoded values and BitTorrent Metainfo file handling in F#

Byte strings can be strings represented as byte strings (such as the description of the exchanged data), as well as an array of bytes (such as a hash). Representing them with the .Net strings can thus lead to errors. Hence we shall keep the byte array representation.

 

Julien Ortin continues his series on Purely Functional Data Structures with a Skew binomal heap, a Banker’s double-ended queue, a Alternative binary random access list, a Bootstrapped queue, and a Implicit queue.

This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.

 

Scott Seely’s F# is Changing My Style

The types I’m interested are concrete (no abstract methods) and have a zero-argument constructor. A few years ago, I would have done a bunch of looping constructs to look at each element. However, I’ve been doing a lot more work with F#. While doing this experiment in C# for a project, I wound up writing the following instead:

 

Steve Gilham’s It almost feels like cheating…

Having renamed all the .c files as .cpp, getting a first building assembly was simple, and then making it refer to an initially empty F# library, no problem; and then setting up an (again, initially empty) unit test assembly depending on both (where vice-tests to match up new and old implementations, and their eventual unit test replacements can accumulate), just as normal.

 

Brad Clow’s F# Examples talk at BFG

Earlier this week I gave a short talk at the Brisbane Functional Group on F#. The idea was to give an introductory feel for the language by way of some simple examples.

 

Phillip Trelford’s F# Talk at Edge UG: Slides and Demos

I presented a 1 hour talk introducing F# with 4 demos (attached to this post):  Full-screen WPF POS Checkout sample with Barcode scanner integration (in 100 lines).  Twitter WPF client script (200 lines).  Matermind board game in WPF (300 lines).  Lunar Lander XNA game (>400 lines).

 

Matt Jackson’s AssertWasCalled in F# (or how I learned to stop worrying and hate extension methods)

Unfortunately, this upcasting led me on a short goose chase to find out which interface in the Rhino Mocks codebase was responsible for AssertWasCalled only to realise that it was an extension method sitting hiding away somewhere else.

The more I use F# the more I want to write my every day production C# code in a functional way.  To this end, I’ve written a few higher order extension methods as the need arose.  I wanted to take a moment and share them with you.  I think that in seeing an implementation of these functions in C#, what they do becomes easy to understand.

Filter provides a new collection with unwanted items removed. 

public static IEnumerable<T> Filter<T>(this IEnumerable<T> list, Predicate<T> predicate)
{
    List<T> newList = new List<T>();
    foreach (var item in list)
    {
        if (predicate(item))
            newList.Add(item);
    }
    return newList;
}

 

Reduce boils down a collection into exactly one item of the collection’s containing type.

public static T Reduce<T>(this IEnumerable<T> list, Func<T, T, T> function)
{
    var enumerator = list.GetEnumerator();
    enumerator.MoveNext();
    var last = enumerator.Current;
    while (enumerator.MoveNext())
    {
        last = function(enumerator.Current, last);
    }
    return last;
}

 

Fold is much like reduce except that it boils the collection down into an instance of any type.

public static U Fold<T, U>(this IEnumerable<T> list, Func<T, U, U> function, U initial)
{
    var enumerator = list.GetEnumerator();
    var last = initial;
    while (enumerator.MoveNext())
    {
        last = function(enumerator.Current, last);
    }
    return last;
}

 

Map takes one collection and returns another of the same length by applying a function to each element.

public static IEnumerable<U> Map<T, U>(this IEnumerable<T> list, Func<T, U> mapFunction)
{
    List<U> newList = new List<U>();
    foreach (var element in list)
    {
        newList.Add(mapFunction(element));
    }
    return newList;
}

 

While these four are a good subset to begin with, F# provides a much broader range of IEnumerable functionality.  Also, while examples here build new lists, their F# counterparts often evaluate lazily and so are usable with very large, parallelized or even infinite sequences. 

For a more detailed view with some F# and Linq code check out Matthew Podwysocki’s post on learning Functional C# from F# and LINQ.  His example are actually lazy when appropriate and have precondition checks.

Back again with another F# community roundup.   There’s been a ton of great content this week, almost too much.  To try to combat this I’ve attempted to sort posts roughly in terms of how interesting I found them.  All were worth the read though.

Also, I’ll be speaking this Wednesday on F# at the Boston .NET User Group.  If you find yourself there, be sure to say hello!

 

Don Syme’s Introduction to F# (Video 1 of 3)

Dr. Don Syme is a principal researcher in MSR Cambridge. He has a rich history in programming language research, design, and implementation (C# generics being one of his most recognized implementations), and is the principle creator of F#.

 

Ashley Feniello’s FScheme Part 8: Language vs. Library

Perhaps this post should have gone along with the one about macros and how Lisp is a “programmable programming language.” The common tension in any language or runtime design is how much to build in as primitives and how much to implement as libraries within the language or atop the runtime.

 

Luke Hoban’s F# for Parallel and Asynchronous Programming

Last November at PDC 2009 in Los Angeles I gave a talk on F# for Parallel and Asynchronous Programming.  The talk begins by covering basic F# concepts, and then focuses on four challenging issues related to concurrency and the tools F# brings for addressing these - immutability, async workflows, and agents.

 

Andrew Brehaut’s On Iteration (Could just as well be entitled “Why Programmers Leave Python/C#/Java")

There is an observable trend in Python programmers that results in a reasonable section of them moving to functional programming languages. This trend is encouraged by the Python language, and has a couple of temporal considerations.

 

Matthew Podwysocki’s Using and Abusing the F# Dynamic Lookup Operator

Much like C# 4.0 has the ability to do dynamic lookup, F# also has the same capability, although in a different capacity.  The language has support for a dynamic lookup get operator ( ? ) and set operator ( ?<- ), but note that I said support and not actual implementation.  The actual implementation is up to you and how you want to use it. 

 

Matthew Podwysocki’s A Kick in the Monads – Writer Edition

In the past couple of Monads posts, we’ve talked briefly about the State and Reader Monads and their potential uses and misuses.  Before this series completes, I have a few more to cover including the Writer, Continuation and eventually Observable monad.  Today, we’ll get started looking at the Writer Monad and what it can do for us.

 

Ashley Feniello’s Recursion Is the New Iteration

Not all recursive expressions represent recursive behavior. In fact, iteration can be expressed recursively. One trick when considering the process that an expression represents is to think of functions as reducing to values rather than returning them. In a pure functional style (precisely because of referential transparency) you can do analysis by successive substitution.

 

Julien Ortin continues his series on Purely Functional Data Structures with a Real-time double-ended queue, a Skew binary random access list and a Binary random access list

This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.

 

Flying Frog Consultancy Presents - John Conway’s Game of Life in 32 lines of F#

John Conway's Game of Life is a famous example of a simple cellular automaton that produces remarkably diverse results. The game can be implemented in only 32 lines of F# including real-time visualization using Windows Presentation Foundation as follows:

 

Brian McNamara’s An RSS Dashboard in F# (Part 3)

Last time I covered IObservables and we created a useful ObservableSource class.  Today I’ll cover the next technology piece of the app: reading RSS feeds.  I’ll discuss the design considerations regarding how to poll feed for updates and publish feed items as IObservables, and walk through one implementation.

 

Nick Gravelyn’s Pong in F# with XNA Game Studio

A few of my colleagues were discussing F# today and when/where/how it is/isn’t better than C#. I haven’t ever really used F# beyond a very, very brief look at the syntax, so tonight I decided to see what it was all about. As a little project, I decided to make Pong with XNA Game Studio using F# with Visual Studio 2010.

 

Jim Burger’s Maybe F# isn’t for you…

If you aren’t excited about new ways to tackle the concurrency problem, or new approaches to handling generic and mathematical problems, and if the thought of breaking out the shiny new lexer and parser don’t give you a tingle, then maybe F# isn’t actually marketed at you at all.

 

Alex Turner’s Calling F# from COBOL and Back Again (CodeProject)

Running languages on .NET is ultra-powerful. Using managed COBOL (from Micro Focus), it is possible to use F# code to work with COBOL code. Imagine a Cloud based F# map reduce system consuming legacy COBOL - yes, that really is on the horizon.

 

Steffen Forkmann’s New syntactic sugar for “FAKE – F# Make”

The new version 0.27 of “FAKE – F# Make” comes with new syntactic sugar for build targets and build dependencies. Don’t be afraid the old version is still supported – all scripts should still work with the new version.

 

Jared Parsons’s Having fun with events in F#

Recently I ran into a situation where I needed to handle some events in F# in a special way.  In this particular case I wanted to be able to disable and re-enable my handler based on changes in the program.  Essentially the C# equivalent of continually adding and removing the handlers. 

 

Steve Gilham’s “Hello Glade#” from F#

Another bit of spiking, a rather tardy follow up from raw GTK#, starting from the C# example at the Mono Project site, but incorporating the earlier example, so as to build in a clean application exit, for one thing.

 

Luis Diego Fallas’s Using a Webcam with WIA and F#

In this post I'm going to show a small example of taking a picture using a Webcam with Windows Image Adquisition 1.0 . This API seems to have changed in Vista and above, the following code only applies to XP.

 

Flying Frog Consultancy’s WPF Tic-tac-toe demo

The article walks through the design and implementation of a multithreaded program that uses logic programming to create an unbeatable computer opponent and Windows Presentation Foundation to provide a graphical user interface in only 115 lines of elegant F# code!

 

A (Relatively Reasonable) Discussion of F# on Slashdot

OCatenac passes along an interview with Don Syme, chief designer of F#, which is Microsoft Research's offering for functional programming on the .Net platform. Like Scala, which we discussed last fall, F# aims at being an optimal blend of functional and object-oriented languages.

Many apologies if I missed your post.  Having skipped last week due to some uncontrollable circumstances left me with quite a large number to sort through.  My personal favorite this week is Ashley Feniello’s series.  SICP eat your heart out.

 

Richard Morris’s Geek of The Week is Don Syme

“It came as a surprise to many of us when Microsoft pulled from it's hat a rabbit in the form of an exciting, radical, language that offers an effective alternative to the Object-oriented orthodoxy. The creative force behind this language, F#, turns out to be a brilliant Cambridge-based Australian called Don Syme, already well known for his work on generics in .NET.”

 

Ashley Feniello’s extremely cool eight part (so far) series FScheme:

“One of my New Year’s goals is to re-read Lisp in Small Pieces and implement all 11 interpreters and 2 compilers. As much as I like the "Lisp in Lisp" idea and enjoyed the eureka moment in SICP when Sussman writes the metacircular interpreter on the board to the music from Space Odyssey, I don't want to do Lisp in Lisp itself. Lisp in F# sounds like more fun.”

Part 1: FScheme - Scheme in F#
Part 2: Just ‘let’ Me Be Already!
Part 3: Lambda the Ultimate!
Part 4: Rinse and Recurse
Part 5: What ‘letrec’ Can’t Do
Part 6: What's Lisp Without Lists?!
Part 7: No Wait, Macro the Ultimate!
Part 8: Oh, The Humanity!

 

Matthew Podwysocki’s Series - Creating Extended Builders Part 1, Part 2 and Part 3

“But, what we lack is an imperative programming model on top to allow for such things as if statements, for and while loops, and try/catch or try/finally blocks.  Luckily, there is a programmatic model to follow to make these things possible inside of our expressions.  Let’s cover each of these functions in turn and see what each one does and in the process implement them for the Reader Monad.”

 

Chris Smith’s Being an Evil Genius with F# and .NET

“Rather than doing the prototypical “Intro to F# Talk” I figured I go with something a bit more fun and relevant to the every day developer. Sure F# is neat and everything – but why bother to learn a new programming language unless you can use it to do something meaningful. Well, in addition excelling at both functional and object-oriented programming, F# is ideal for world domination.”

 

Tomas Petricek’s Accelerator and F# (IV.): Composing computations with quotations

“In this part of the series, we're going to look at working with quotations explicitly. We'll use meta-programming techniques to work with Accelerator. Meta-programming means writing programs that manipulate with other programs or pieces of code.”

 

Luke Hoban’s Tuning a Parallel Ray Tracer in F#

“One of the samples that is included with the Parallel Programming Samples for .NET 4 is a simple Ray Tracer.  This ray tracer provides a nice visual way of seeing the benefits of .NET 4 parallelism features, as well as giving insights into the way work stealing happens under the hood.”

 

Julien Ortin continues his series on Purely Functional Data Structures with a Scheduled binomial heap, Scheduled bottom-up merge sort and a Hood-Melville queue

“This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.”

 

Julien Ortin’s Rate meter in F#

“The following code allows us to measure (and keep track of) the exchange rate (whether upload or download), and the time needed to exchange n additional bytes (assuming the rate is stable).”

 

Julien Ortin’s Two-way traffic control in F# – bucket approach

“The following approach is based on a per-request basis. That is, an actors asks for n tokens to read (or write), and the manager sends it an answer when the actor is allowed perform the action. In effect, if the actor asks for 100 bytes and only 50 bytes can be exchanged per second, it will get a green light only after two seconds have elapsed.”

 

Stasyan continues his Red and Black tree Series with Insertion, Deletion, Extras and a Post-Mortem.

“But it works nevertheless. I did some random testing of 10000 elements. Insertion and deletion worked. The cool thing is that the Black height of the tree with 10000 elements does not exceed 10.”

 

Granville Barnett Review’s F# for Technical Computing

“An F# book by Jon brings with it excitement and promise: his work is well known for being clear and concise, and the examples he uses to help the reader familiarise themselves with the application of F# are highly stimulating.”

 

David Worthington’s WebSharper platform seeks to broaden F# use

“Microsoft's F# language is best suited for financial and scientific applications, but a startup wants to broaden its usage to building mainstream Web applications.”

 

Ade Miller’s Implementing a Parallelized Octree in F#

“What’s an octree? An octree is a tree structure where each node has up to eight children, one for each of the octants. You can think of them as a three dimensional variation on a binary tree.”

 

Diego Echeverri’s Data Visualization with Websharper

“In this post I'll show you how to make a nice visualization similar to the ones used by Hans Rosling. For this, we'll use the WebSharper Google Visualization bindings available as an extension package to the core platform.”

 

Matt Manela’s Regex based Lexer with F#

“This lexer allows you to define your regular expression based rules in a very declarative way using F# computation expressions.”

 

Phillip Trelford’s Sorted with F# custom operators

“F# lets you define your own operators, and like a man with a new hammer hunting for nails :) I’ve found an application of F# custom operators for sorting multiple columns.”

 

Chris Rizzuto’s Http Requests in F# using a TCPClient

“Obviously a few ways to do this using WebClient, HttpRequests, but in this case I decided to use a TcpClient object as I liked the control, and the ability to easily access the textual outputs.”

 

Chris Rizzuto’s F# WCF Service to calculate StdDev and Keep Real-Time KPIs, F#, WCF, KPIs, ConcurrentDictionary, First Class Events and Message Queues in F# / Building into the KPI Service

“First, below is the functions and events to calculate StdDev.  Thanks again LukeH for doing all the work for this part.  I only made a small change by adding a new method for handling the event when it is raised, and to make Mean and StdDev accessible from a WCF web service so that if polled for the current values, it is able to return them to the user.”

 

Cameron Taggart’s List Transactional WCF Bindings in F#

“The code uses LINQ to print a list of WCF binding that have a default constructor and support transactions.  I think it actually is a whole lot more readable in F#”

 

Cameron Taggart’s Hello World for Bing Maps + Silverlight + F#

“The Bing Maps Silverlight Control was released in November.  […]  I’ve committed code for this blog that shows you how to get started with it using an F# Silverlight application.  I did not need to write any C# or XAML.”

Scott Seely’s F# is Changing My Style

“A few years ago, I would have done a bunch of looping constructs to look at each element. However, I’ve been doing a lot more work with F#. While doing this experiment in C# for a project, I wound up writing the following instead:”

Back again this week with a fresh batch of F# Posts, Videos and Events.  I’ve been enjoying Matthew Podwysocki’s “Much Ado About Monads” series quite a lot.  They are well worth checking out for beginner and advanced alike.

 

Events

If you would like to see your event here, send me an email via the link at the top of the page.

Rick Minerich - Charleston SC Technology Users Group on the 27th of January (check out the awesome flier)

Steffen Forkmann - Frankfurt .NET Usergroup on the 21st of January

 

Posts

Don Syme’s Async and Parallel Design Patterns in F#: Parallelizing CPU and I/O Computations

One simple way to write parallel and reactive programs is with F# async expressions. In this and future posts, I will cover some of the basic ways in which you can use F# async programming - roughly speaking, these are design patterns enabled by F# async programming.

 

Don Syme’s F# Interactive Tips and Tricks: Visualizing Data in a Grid

The demos in my F# talks use a number of coding snippets to acquire, generate and display data interactively. Some of these little snippets are not so well known, but they are useful :-)

 

Don Syme’s F# Interactive Tips and Tricks: Formatting Data using AddPrinter, AddPrintTransformer and %A in sprintf/printf/fprintf

Here are some tips and tricks for formatting data in F# Interactive. This is not meant to be a comprehensive guide, just enough to get you started. Please let me know if you need more examples.

 

Matthew Podwysocki’s Much Ado About Monads – Reader Edition

So, our ultimate goal would be instead to have our environment set once and then read from it implicitly.  We still want to keep what we have here in terms of our script, but change the underlying mechanism for how it happens.

 

Anton Schwaighofer’s SkillsMatter.com talk: F# and Units-of-measure for Technical Computing

I will start by giving an introduction to units-of-measure and their implementation in F#. I'll work through smaller and larger code examples that make use of units-of-measure.

 

Nancy Strickland’s MSDev.com Training Session on F#

Visual Studio 2010 includes a new programming language, F#. This session explains and provides a walk-through demonstration of basic programming in F#.

 

Julien Ortin continues his series on Purely Functional Data Structures with a Lazy Pairing Heap, a Real-time Queue and Bottom-up Merge Sort

This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.

 

Mauricio Scheffer’s Translating Haskell to F# and other considerations

BUT, syntactic similarity does not imply that they're semantically the same. There's a fundamental difference from the original code: Haskell is a lazy language, while F#, coming from the ML-family, does eager evaluation.

 

Mark Needham’s F#: Refactoring to pattern matching

I was looking through some of the F# code I've written recently and I realised that I was very much writing C# in F# with respect to the number of if statements I've been using.

 

Mark Needham’s F# attempt at Roy Osherove’s TDD Kata

As I've mentioned in a few of my recent posts I've been having another go at Roy Osherove's TDD Kata but this time in F#.

 

Holoed’s Weak Subscribe to an IObservable Source

A code snippet describing how to subscribe to an event via a weak reference.

 

Erik Schulz’s Resource Pool in F#

I’ve been toying around with F# recently, it’s good to see an example that you can easily compare and contrast with the C# version.

 

Ade Miller’s Gotchas: Common Traps for the F# n00b

I spent a bunch of time over the holidays getting to know F# a bit better. I think I now consider myself to be truly dangerous with it.  A couple of things which repeatedly bit me as I stumbled through learning F# as a n00b.

It’s 2010, the year of F#, and the quantity of posts in this last week reflects it.  Not to pick favorites but the work Tomas Petricek has been doing with Accelerator is amazing, be sure to check it out.

Also, I’d like to thank everyone who supported me on the road to becoming a Microsoft MVP.  I couldn’t have done it without you.

 

Tomas Petricek parallelizes Quotations with Accelerator

In this article, we'll look at more sophisticated way of using Accelerator from F#. We'll introduce F# quotations and look at translating 'normal' F# code to use Accelerator.

 

Don Syme Posts updates his F# JAOO tutorial code

I've now updated this tutorial code for the F# Visual Studio 2010 Beta2 release (with matching CTP release for Visual Studio 2008). We've also added some more content and explanatory comments.

 

Matthew Podwysocki investigates the State Monad

In the past, I’ve had a series on Much Ado About Monads where I look at the basic Monads such as Maybe and List, but this time, let’s look at what we can do with the State Monad.

 

Adam Granicz shows off WebSharper at the Hungarian Web Conference

In this talk, I will present our new web development platform, WebSharper(TM), that leverages the power and expressiveness of F# to allow .NET developers to write robust web applications in mere hours.

 

Chance Coble and Ted Neward release DZone Refcardz for F#

This DZone Refcard will lead you through the basic essentials so that you can quickly move on to using this Functional Programming Language for creating some mind-bending code.

 

Talbott Crowell posts his FSUG Parallel Programming Talk

In this video, I discuss some of the advantages of .NET 4 and F# for asynchronous programming plus some of the new analysis tools built into Visual Studio 2010 for visualizing concurrency.

 

Steffen Forkmann creates a ‘FAKE – F# Make’ group on BitBucket and releases version 0.17

Due to its integration in F#, all benets of the .NET Framework and functional programming can be used, including the extensive class library, powerful debuggers and integrated development environments like Visual Studio 2008 or SharpDevelop, which provide syntax highlighting and code completion.

 

Julien Ortin continues his series on Purely Functional Data Structures with a Physicist Queue, a Lazy Binomal Heap and a Bankers Queue

This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.

 

Mathias Brandewinder StackOverflows on Unit Testing with F#

So far, my process with F# has been to write some functions, play with them with the interactive console until I am "reasonably" sure they work, and tweak & combine. This works well on small-scale problems like the Euler Project, but I can't imagine building something large that way.

 

Chas Emerick demonstrates the problem with mutable objects

316 arguments to a method (which I don't think is actually possible in the jvm, but bear with me)? "That's absurd!", you'd say. The problem, of course, is that the 3-arg doSomething actually has far more arguments than its signature implies:

 

A Mysterious Stranger implements a Red-Black Tree

Both 2-4 and Red and Black tress are self balancing trees. They are kind of like cousins, since one could be converted into the other quite easily. Hence all performance analysis that apply to 2-4 trees applies to Red and Black trees.

 

Mark Needham discusses expressing intent with application operators

While trying out Roy Osherove's TDD Kata I realised that perhaps the choice of which of these to use or whether to use them at all depends on what intent we're expressing.

It’s been a bit of a light week with the holidays.  Although, for the truly dedicated, that’s just a chance to get some quality time in with with a favorite programming language (or to write a poem about it).

 

Tomas Petricek uses Accelerator in a GPU Game of Life simulation

This article is the second one from a series about using Accelerator from F#. Today, we'll use Accelerator types directly from F# - this is the simplest possible approach and is very similar to the way you'd work with Accelerator in C#.

 

Robert Sundström explores GCD and LCM in F#

I have spent this evening composing some mathematical functions in F#. So far I have just made two for gcd and lcm and one that can identify prime numbers. I want like to share the code with you.

 

Robert Pickering describes his work on FunctionalNHibernate

In the future I’ll be looking at how to broadening what you can do with FunctionalNHibernate ClassMap descriptions and improve data access by integrating Linq like features.

 

Flying Frog solves Rosetta Code’s Data Munging 2 Example

Perhaps the most surprising result is that the F# solutions are extremely concise even when compared with bleeding-edge research languages such as Haskell.

 

Flying Frog plays with Generic Algorithms

The program begins with a random string of letters and spawns a generation of 200 random mutations of the parent string, selects the fittest mutation (by similarity to an "ideal" string) and uses that individual to spawn the next generation. The ideal string used is "METHINKS IT IS LIKE A WEASEL".

 

Julien Ortin uses F# to clean up his temporary internet files

A quick and dirty F# script to clean temporary internet files (including Flash cookies which don’t get deleted by the browsers).

 

Steffen Forkmann observes asynchronous downloads with Rx and F#

This time I will demonstrate how we can use this API and asynchronous workflows to download a couple of websites asynchronous and in parallel.

 

The PFX Team tours the .NET 4 Parallel Programming Samples

On Code Gallery, we have a plethora of samples that highlight aspects of the .NET Framework 4 that help with writing scalable and efficient parallel applications.  This post examines each of those samples, providing an overview of what each provides.

 

Satnam Singh writes a poem about F#

Distracted by Abstraction - A poem about F#

Recently I’ve been working with some local search techniques and wanted to share my Steepest Ascent Hill Climbing solution.

The general idea of Steepest Ascent Hill Climbing is that in each iteration of the hill climbing process you apply a set of transforms to your input data and select the best result via a fitness function.  This result, or the transform which created it, is then the input for your next iteration.  The process stops when no transform in an iteration scored higher than the previous generation’s winner.

In this way each iterative step brings you closer to a local maxima of your fitness function’s graph.  This is where the term “Hill Climbing” comes from.  It is considered a relatively simple AI technique but is also is broadly applicable, quite easy to reason about and can be tweaked for many different corner cases.

For this particular example we will be assuming composable transforms.  For each iteration of our hill climbing we will apply our standard transform set to the winning transform of the last round and so produce a new set of transforms.  

public delegate T TransformComposer<T>(T lastT, T thisT);
public delegate S TransformApplier<S, T>(S set, T transform);
public delegate uint FitnessFunction<S>(S set);

public class HillClimberResult<S, T>
{
    public HillClimberResult(uint score, T transform, S set)
    {
        Score = score;
        Transform = transform;
        Set = set;
    }

    public uint Score { get; private set; }
    public T Transform { get; private set; }
    public S Set { get; private set; }
}

public class HillClimber<S, T>
{
    public HillClimber(
      TransformComposer<T> composer,
      TransformApplier<S, T> applier,
      FitnessFunction<S> fitness)
    {
        TransformComposer = composer;
        TransformApplier = applier;
        FitnessFunction = fitness;
        Transforms = new List<T>();
    }

    public List<T> Transforms { get; private set; }

    private TransformComposer<T> TransformComposer { get; set; }
    private TransformApplier<S, T> TransformApplier { get; set; }
    private FitnessFunction<S> FitnessFunction { get; set; }

    public HillClimberResult<S, T> FindMaxima(S inputSet, T initialTransform)
    {
        if (inputSet == null)
            throw new ArgumentNullException("inputSet");
        if (initialTransform == null)
            throw new ArgumentNullException("initialTransform");
        if (Transforms.Count == 0)
            throw new ArgumentException("No transforms were set.");

        HillClimberResult<S, T> best;
        HillClimberResult<S, T> iterBest = ApplyTransformAndScore(inputSet, initialTransform);

        do
        {
            best = iterBest;
            foreach (T transform in Transforms)
            {
                var nextTransform = TransformComposer(best.Transform, transform);
                var result = ApplyTransformAndScore(inputSet, nextTransform);
                if (iterBest.Score < result.Score)
                    iterBest = result;
            }
        } while (iterBest.Score > best.Score);

        return best;
    }

    private HillClimberResult<S, T> ApplyTransformAndScore(S inputSet, T transform)
    {
        var transformedSet = TransformApplier(inputSet, transform);
        var score = FitnessFunction(transformedSet);
        return new HillClimberResult<S, T>(score, transform, transformedSet);
    }
}

 

I like the way this worked out in C# quite a lot.  However, take a moment to compare it to a F# version I quickly whipped up: 

type HillClimber(composer, applier, fitness, transforms) =
    member x.FindMaxima initialSet initialTransform =
        let maxOfScores one two = if fst one > fst two then one else two
        let findBestTransform set lastTransform =
          transforms
            |> List.map (fun(transform) -> composer lastTransform transform)
            |> List.map (fun(transform) -> applier set transform, transform)
            |> List.map (fun(transformedSet, transform) -> (fitness transformedSet), transform)
            |> List.reduce maxOfScores
        let rec climb set lastScore lastTransform =
            let (thisScore, thisTransform) = findBestTransform set lastTransform
            if thisScore <= lastScore then (lastScore, lastTransform)
            else climb set thisScore thisTransform
        climb initialSet (fitness initialSet) initialTransform

 

It’s quite shocking how much less code is necessary.   However, there is a small problem with this example.  As we are not using HillClimber from inside of its own library, all of its function inputs resolve to System.Object. The solution is to simply do a bit of annotating to ensure that compile time types are as generic as possible.

type TransformComposer<'t> = 't -> 't -> 't
type TransformApplier<'s,'t> = 's -> 't -> 's
type FitnessFunction<'s> = 's -> float
  
type HillClimber<'s,'t>(composer: TransformComposer<'t>, applier: TransformApplier<'s,'t>, fitness: FitnessFunction<'s>, transforms: list<'t>) =
    member x.FindMaxima initialSet initialTransform =
        let maxOfScores one two = if fst one > fst two then one else two
        let findBestTransform set lastTransform =
          transforms
            |> List.map (fun(transform) -> composer lastTransform transform)
            |> List.map (fun(transform) -> applier set transform, transform)
            |> List.map (fun(transformedSet, transform) -> (fitness transformedSet), transform)
            |> List.reduce maxOfScores
        let rec climb set lastScore lastTransform =
            let (thisScore, thisTransform) = findBestTransform set lastTransform
            if thisScore <= lastScore then (lastScore, lastTransform)
            else climb set thisScore thisTransform
        climb initialSet (fitness initialSet) initialTransform

 

Of course,  it would be great if the F# type system would reduce to generics instead of System.Object in this case.  I would think the ideal would be to always reduce to the most generic type possible.  I’ll have to give it a try tonight with the latest VS2010 beta and see if there is any improvement.

Continuing on, let’s give this a go with something simple.  We know that the maximum value of |A| – A^2 is 0.5, –0.5.  Can we climb our way to one of these values?

#load "HillClimber.fs"
open HillClimber

let composer last next = fun x -> (last x) + (next x)
let applier set transform = transform set;
let fitness x = abs( x ) - (x ** 2.0)
let transforms = [fun x -> x + 1.0;
                  fun x -> x - 1.0;
                  fun x -> x + 0.1;
                  fun x -> x - 0.1;
                  fun x -> x + 0.01;
                  fun x -> x - 0.01]

let climber = new HillClimber<float,float->float>(composer, applier, fitness, transforms)

let initialValue = 0.0
let (score, transform) = climber.FindMaxima initialValue (fun x -> x)
let result = transform initialValue

…Highlight, Alt-Enter…

val composer : ('a -> float) -> ('a -> float) -> 'a -> float
val applier : 'a -> ('a -> 'b) -> 'b
val fitness : float -> float
val transforms : (float -> float) list =
  [<fun:transforms@10>; <fun:transforms@11-1>; <fun:transforms@12-2>;
   <fun:transforms@13-3>; <fun:transforms@14-4>; <fun:transforms@15-5>]
val climber : HillClimber.HillClimber<float,(float -> float)>
val initialValue : float = 0.0
val transform : (float -> float)
val score : float = 0.25
val result : float = -0.5

Looks good!

 

Well, it looks like that took a bit longer than I had anticipated.  I’ll be back with my weekly update tomorrow.

By far the most exciting news this week was the preview release of Microsoft Research Accelerator.  Posts on this topic by Satnam Signh and Tomas Petricek have left the F# world buzzing.  This, however, is just the tip of the F# iceberg.  News of the F# Survival Guide’s release and a number of other exciting posts follow.

 

-- F# --

Satnam Singh demonstrates GPGPU and x64 multicore programming with Accelerator

Microsoft recently released a preview of the Accelerator V2 GPU and x64 multicore programming system on Microsoft Connect. This system provides a civilized level of abstraction for writing data-parallel programs that execute on GPUs and multicore processors. An experimental FPGA target is under development.

 

Tomas Petricek explores Microsoft Research Accelerator

The project used Microsoft Research Accelerator, which is a C# library for developing array-based computations and executing them on a GPU. […] In this article, we'll look at the simplest way of using Accelerator from F#. Accelerator provides a managed interface that can be naturally used from both C# and F#.

 

The F# Survival Guide – a Free eBook

Welcome to the F# Survivial Guide by John Puopolo with Sandy Squires. We wrote this book to introduce mainstream developers to the world of functional programming through the lens of F#, Microsoft's first fully-supported multi-paradigm language.

 

Matthew Podwysocki builds a Shopping Cart in F#

Where functional programming has an immediate impact and probably the largest is programming in the small.  Here, we can focus on such things as immutable values, higher order functions, recursion, pattern matching and others come into play.  When we’re talking about mixing paradigms, object oriented programming has a larger effect on programming in the medium where we’re organizing our code and can some times offer a more elegant solution than a functional programming one.

 

Brian McNamara explores IObserver and IObservable

At core, IObservable is just about two new small interfaces, IObservable<T> and IObserver<T>, being added to .Net 4.0.  We’ll come to the details of those interfaces shortly.  What is exciting and useful about IObservable is that these interfaces admit very nice programming models, including LINQ (e.g. for C#) and the Observable module (for F#), that provide useful combinators for transforming and using event streams.

 

Steffen Forkmann maps the Reactive Framework operators to F#

The “Reactive Extensions for .NET (Rx)” comes with lot’s of operators for using IObservable<T>. This code mimics the signature of the default F# sequence combinators and allows to use observables like sequences. It is a similar approach like Matthews Podwysocki’s blog post about mapping the IParallelEnumerable.

 

Robert Pickering introduces FunctionalNHibernate

It’s already fairly well documented that F# doesn’t play too well with NHibernate and Fluent NHibernate, although you can make it play a littler nice with a bit of effort. However there are a few fundamental problems with this approach.

 

Bistro FSharp Extensions 0.9.5.0 is released

The new release drastically improves the project's interaction with the inference capabilities of F#. A majority of controllers can now be written without the need for discriminated union annotations, or let bindings for naming.

 

Julien Ortin continues his series on Purely Functional Data Structures with a Splay heap, a double-ended queue and a Pairing heap.

This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.

 

Jared Parsons makes F# type inference friendly to C#

When working with the exposed core Vim engine API, I’ve found a number of generated F# constructs which are not easily accessible from C#.  The problem stems from the manner in which native F# types are exposed.  Many of them are generic and  lack type inference friendly helper methods that force awkward usage patterns in C#.

 

Alex Pedenko discusses code compression with F# and MVC

While the underlying concepts are the same, a recent stint with Django (which is a strong influence in the Bistro framework) reminded me of how little work you have to do in python to get going with a controller, and that bistro and the fs extensions still have some catching up to do on the brevity front.

 

Matt Davey muses over F# within a Single Dealer Platform

I’ve been thinking about F# for a while and its use within finance. A number of banks have been looked at F# from an analytical viewpoint – obvious, and hence boring.  What is more interesting it how F# possible elevates the building of a Single Dealer Platform (SDP).

 

Mark Needham does Word Count using a Dictionary

Having spent some time unsuccessfully trying to make my F# attempt at the word count problem work I decided to follow the lead of the other examples I've read and make use of a Dictionary to keep count of the words.

 

-- Misc Others --

Functional Programming eXchange – a Ning network for FP

Mark Dominus on why Monads are like burritos

Crash Monad Tutorial

Stuart Sierra on why Objects are not Abstract Data Types

Perlisms - “Epigrams in Programming” by Alan J. Perlis

An almost overwhelming number of posts this week with topics including the Skills Matter Programming Exchange, LAgent, data structures, service oriented architecture, monads, infinite sequences, timing F# functions, functional design, and much more.  Come in and check it out.

 

Don Syme on WebSharper: F#-based Rich Client/Server Web Applications

Intellifactory seem to have set about answering the question of "just how simple, clean and productive can you make developing rich web applications that target Javascript?" (my words, not theirs).  While still in beta, signs are that Intellifactory are putting together an impressive technology that makes really good use of F#'s unique facilities to simplify this class of applications.

 

Mike Hadlow on the Skills Matter Functional Programming Exchange

I had a great time today at the Functional Programming Exchange organised by Robert Pickering and Skills Matter. Robert managed to grab some really interesting speakers who gave a nice snapshot of the current art and use of FP.

 

Luca Bolognese on LAgent: an agent framework in F# – Part X – ActiveObject

So you start thinking if there is a way to enhance vanilla objects to make them agents. You want to reuse all the concepts that you are familiar with (i.e. inheritance, visibility rules, etc…) and you want your clients to call agents as if they were calling normal objects. Obviously, under the cover, the method calls won’t execute immediately, but they would be queued.

 

Ted Neward’s A New Kind of Service

Why study new and different programming languages? To change your programming mindset. Not sure what I mean by that? Check this out.

 

Anton Tayanovskyy on Generic Workflow Builders (Monads) in F#

This blog post is about a quick and dirty encoding of Haskell type classes in F#. With the ongoing work on the WebSharper™ project, we are currently very interested in coaxing the .NET type system to support writing code that is generalized over monads and applicative functors.

 

Anton Tayanovskyy on Foldr or FoldBack on Infinite F# Sequences

A noticeable omission in F# standard library is Seq.foldBack, or the famous Haskell foldr. The semantics of foldr is very simple to remember: it replaces the native cons and nil of a list with arbitrary computations.

 

Anton Tayanovskyy on The Execution Speed of Early vs Late Binding

This little post documents one of my little experiments with F#, as I am educating myself on the .NET Framework fundamentals.

This post is also interesting because it describes how to turn on timing in F# interactive.

 

Julien Ortin’s Purely Functional Data Structures in F#: Batched Queue, Binomal Heap and Red-black Set

This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.

 

Justin Lee’s Infer.NET – Now with F# Support

Infer.NET is a framework for running Bayesian inference in graphical models. You can use it to solve many different kinds of machine learning problems, from standard problems like classification or clustering through to customised solutions to domain-specific problems.

 

Joh’s Inheritance Nightmares

At this point, readers interested in F# and functional programming languages might wonder what all this has got to do with F#. I think that the common mix of mutability and inheritance is not a very strong basis for good software design. I never really realized that until I took a look at functional programming and immutability.

 

Talbott Crowell’s Slides from Parallel and Concurrent Programming with F#

As promised, please find the slides and source code for the demos.

 

Ryan Riley Discusses F# on the HighOnCoding Podcast

Last week I had the pleasure of recording a podcast with Ryan Riley about F# programming language. Ryan discussed different features of the F# language and how it can be used to build applications.

 

Cameron Taggart’s F# on Mac using Cocoa

Laurent Etiemble created a Monobjc project/library that allows access to Objective-C frameworks and libraries like Cocoa.  I just ported the first tutorial to F#.  I’m able to build it on my PC and run it on my Mac.

 

Mark Needham’s Haskell vs F#: Function Composition

I'm reading through John Hughes' 'Why functional programming matters' paper and one thing I've come across which is a bit counter intuitive to me is the Haskell function composition operator.

 

Marius Bancila’s F# Operations on List

In this post I want to show how you can implement common list operations: union, intersection, difference and concatenation.

 

Viabhav Bhandari’s F# – Functional Approach

In this version of interesting programming concepts, I would like to highlight type system based pattern matching available in F#/OCAML, its very unique and extremely useful if you are parsing a structured list or working on a symbol table.

We have a great selection of links this week with topics including discriminated unions, equality and comparison constraints, purely functional data structures, a language performance comparison, and a couple of 1.9.7.8 compatibility tweaks for XNA and Silverlight.

Also, the first Monday of the month approaches and with it another meeting of the New England F# User Group.  Talbott Crowell will be speaking on F#’s asynchronous programming features with a beginner audience in mind. 

 

-- Events --

Talbott Crowell is Speaking at the New England F# User Group

 

-- Links --

Gordon Hogenson Explains Discriminated Unions

In this video, programming writer, Gordon Hogenson explains and gives examples of discriminated unions in F#. 

 

Brian McNamara’s Motivating F# equality and comparison constraints

By reading this blog entry, the reader should learn: what structural equality and comparison are, what is the problem that F# equality/comparison constraints solve, why this problem cannot be solved without a specific language feature, [and] when does a programmer need to care about this.

 

Julien Ortin’s Purely Functional Data Structures in F#: Leftist Heap, Finite Map and Binary Search Tree.

This post describes the F# implementation of the [leftist heap, finite map, binary search tree] from Chris Okasaki’s “Purely functional data structures”.

 

Phillip Trelford’s C++ vs C# vs F# vs Haskell

Since I first posted an F# solution to Left-Truncatable Primes, C# and Haskell have entered the frame, and although this is not a good problem for a serious comparison of languages, I think it is still interesting.

 

Steve Gilham’s F# October CTP and Silverlight 3.0

and also his F# and Silverlight 3 addendum

There's an official Silverlight 3.0 project template for Visual Studio 2008; while targetted at the May CTP, these can be used with the October CTP by opening up the .fsproj file and amending the file path for the FSharp.Core assembly.

 

Joh’s F# on the XBox 360

This article describes how to build an XNA Game Studio application using an F# library in such a way that it can be run on the Xbox 360. It applies to the current version of F#, 1.9.7.8.

 

Talbott Crowell’s Adding Parallel Extensions to F# for VS2010 Beta 2

Matthew Podwysocki comes to the rescue with his blog post Adding Parallel Extensions to F#.  Unfortunately his code example doesn't work in VS 2010 Beta 2 (his post was from February.)

A great deal going on this past week with Chris Smith releasing the source samples for Programming F#, Julien Ortin writing a spelling corrector, Matthew Moloney exploring the Azure worker role, Steve Gilham playing with NDepend and a flurry of Reactive Framework (Rx) posting by Matthew Podwysocki and Steffen Forkmann.

 

Chris Smith Releases the Source Code for Programming F#

I've gotten a few requests recently for the source code of the examples in Programming F#. I've attached them as a series of F# Script files.

Disclaimer: I tech edited a portion of this book and so may be a bit biased.

Now that that’s out of the way, you should know that this is currently the only book which is up to date with the plethora of F# API and language changes which have occurred over the past few months.  That’s not to say that it’s not also fantastic in its own right, because it is. 

At the very least giving these code samples a look is well worth your time.

 

Julien Ortin’s Simple Spelling Corrector in F#

This post is based on Peter Norvig’s How to write a spelling corrector, which is written in Python. His spell-checker ranks word-substitution candidates by their frequency in the language as determined by parsing some sources. He then gives different ways which could help make his algorithm more effective, such as taking the context into account (using n-grams).

 

Matthew Moloney’s Azure F# Worker Role with WCF

Azure now has support for input endpoints on Worker Roles! (Azure Tools Nov 2009) This is awesome as it greatly simplifies building WCF services in the cloud.  As per usual, I’ve gone ahead and ported the most important components to F# and I have included a short list of some of the difficulties I had while doing so.

 

Steve Gilham’s Working on F# with NDepend

Following up from the earlier post here, looking more in depth at some of the results out of NDepend for my own little code quality project, and in addition to the results noted there.

 

Matthew Podwysocki’s Going Interactive with the Reactive Extensions

Lately in my series on the Reactive Extensions, you’ll have noticed I focused quite a bit on the IObservable<T> and IObserver interfaces as well as the extensions methods that are included.  There is one thing, however, that might have been missed with the release of the Reactive Extensions is the inclusion of System.Interactive.dll.  The idea behind this is to include many of the extension methods that are available to IObservable<T> and port them to work on the IEnumerable<T> interface.

 

Steffen Forkmann’s Mapping the Reactive Framework operators (Rx) for F#

The “Reactive Extensions for .NET (Rx)” comes with lot’s of operators for using IObservable<T>. This code mimics the signature of the default F# sequence combinators and allows to use observables like sequences.

and … Generating an IObservable<T> from an IEvent in F#

Yesterday I showed how we can map some of the Rx operators to an API which looks more like the F# base classes. Today I wanted to use these mapped operators in a WPF-application written in F#.

Over this past week at PDC I was lucky enough to see some fantastic sessions and spend time with members of the F# and greater Visual Studio language teams.  Naturally, these experiences have left me both floored and swimming in new ideas.  This edition of Discoveries This Week includes both the very best of what I saw at PDC 2009 and the most outstanding things I’ve glimpsed going on in the F# community.  Please do enjoy.

 

Reflection on the PDC Keynotes

For the most information in the shortest amount of time I suggest watching the day one and day two PDC keynotes.  They are both jam packed with exciting announcements and demos.  While at PDC I wrote about my experience watching these here (day one) and here (day two).

 

Microsoft Perspectives on the Future of Programming

Come hear from several of the Microsoft senior technical leaders about the future of programming, programming languages, and tools.

If you watch just one PDC session let this be it. 

With Butler Lampson, Erik Meijer, Don Box, Jeffrey Snover, Herb Sutter, and Burton Smith, Microsoft’s best gathered to debate the future of programming in a twitter driven panel at PDC.  I was happy to be able to contribute with a question on type systems which erupted into quite a disagreement.  I will be writing about this session at length, and reflecting on my past thoughts about this topic, in the near future. 

 

Luke Hoban’s F# for Parallel and Asynchronous Programming

F#, a functional and object-oriented language for Microsoft .NET, adds many tools to make parallel and asynchronous programming both fun and easy. Come hear the core concepts of the F# language, and see how ideas like immutability, functional design, async workflows, agents, and more can be used to meet the challenges of today’s real-world applications.

By combining small, easily understood, ideas Luke constructs F#’s big picture in the most engaging way I’ve seen to date.  This is now my go to talk for people who are interested in, but new to, the F# programming language.

 

Jomo Fisher’s F# Scripting, .NET 4.0 and Mixed-mode assemblies

One of the recent problems we’ve seen is that, because of the support for side-by-side runtimes, .NET 4.0 has changed the way that it binds to older mixed-mode assemblies. These assemblies are, for example, those that are compiled from C++\CLI. Currently available DirectX assemblies are mixed mode.

This clever approach to switching the F# REPL to 2.0 binding mode is particularly handy to know.

 

Matthew Moloney’s Collaborative Development Using F# Interactive

This is a proof of concept of an interactive collaborative development environment I built using  F# Interactive. The aim here is to explore different ideas for further development, not so much as to present an alternative to Visual Studio.

I couldn’t pass this very cool idea up.  I can’t help but think about extending this to full feldged explorative programming community websites.

 

Bart Czernicki’s Silverlight 3 and F# Support in Visual Studio 2010

The goal of this blog post is to make you aware of F# support in Silverlight in Visual Studio 2010.  In addition, this blog post shows an example why F# is going to be very important for Silverlight architects and developers.  Note:  This is NOT an intro to F#.

A great post.  I am always interested in seeing concrete examples of F# adding value to existing technologies and platforms.  I have a sneaking suspicion that there are very few places where it won’t.

Say goodbye to WinForms, WPF, and maybe even AJAX.  Today Scott “The Gu” Guthrie took the stage and blew everyone away with the extensive desktop-app replacing features of Silverlight 4.   This occurred directly after the exciting announcement of free Microsoft branded PDC touchscreen Windows 7 laptops for attendees.  This one-two punch had an unprecedented  shock and awe effect.

 

Silverlight 4.0

Even Migel de Icaza of Gnome and Mono fame couldn’t help but tweet his excitement at the announcement of Silverlight 4.

OMG OMG OMG OMG #silverligh4 has everything I wanted on it: full desktop apps with full system access

 

Silverlight 4.0 Features include:

  • Trusted Apps / Com Support
  • Printing / Webcam / Microphone Support
  • Direct consumption of .NET 4 Assemblies
  • Multicast Streaming
  • Native Drag and Drop
  • HTML Rendering as a Brush
  • Implicit Styles
  • Bidi/RTL
  • Desktop Deployment on Windows and Mac
  • Built-in DRM
  • Huge Speedups

And a whole lot more. 

I recommend checking out the video for yourself as Scott Hanselmann and Facebook’s Brian Goldfarb gave fantastic demos on these new features.

You can grab the beta of Silverlight 4 here.

 

The PDC Laptop

The PDC laptop is extremely cool.  As it is to be the reference implementation for laptop development it has touch screen, swivel top, the whole nine yards.  I’m still waiting for a full charge to power it on but here are some pics to hold you off until then:

43728846 43729067

 

43729156-c6d6e6f8dfb7eba8801d2147783f3e15.4b0497eb-full

 

 

Other Annoucements

Also announced was the Office 2010 Toolchain Open Beta which includes Office, SharePoint, Project and Visio.  The presentation was hard to follow after “The Gu” left my head spinning but it seems there is a huge number of new features in this release for each of the products involved.

No one was surprised this year at PDC when it was revealed that the theme for the show was to be Azure and cloud computing.  What did raise some eyebrows (including my own) was Microsoft’s new found attitude towards interoperability with other technologies.  Not only were the iPhone and the Kindle prominently displayed in the keynote,  the much of the open source stack was also shown as supported on the Azure stack. 

 

Open Source and Azure

It was shocking when Matt Mullenweg, founder of Automatic and father of (PHP based) Wordpress took the stage.  He revealed a set of impressive Wordpress addins which allow for very simple scaling for sites on the Azure cloud.  Scaling to more instances was as simple as increasing an integer in a config file.  Immediately after Martin Cron of icanhascheezbuger fame took the stage and demonstrated how this works with his newly launched oddlyspecific.com

This move to embrace the top of the open source stack is by far the smartest move Microsoft could have made at this point in time.  It should be obvious that fighting a war on four fronts (Apple, Google, Amazon, and Open Source) is a losing battle.  Also, unlike Google which emphasizes open source licensing, Microsoft is emphasizing open platforms, which is much more important.

 

Codename: Dallas

By far the most interesting technical announcement was that of Codename: Dallas.  Dallas is a sort of App Store for data sets.  “Data as a service” if you will.  Here you can download free and paid datasets which also include pregenerated C# and SOAP adapters.  Available datasets include Mars Rover images which I can’t wait to get my hands on.

Vivek Kundra of Data.gov appeared remotely and discussed the possibility of making government data just as easily accessible.  This democratization of data would truly be revolutionary if done well.  Imagine if you could easily run queries directly against EPA data or senate voting data.  The possibilities are endless.

As it turns out, Dallas part of a larger project named Pinpoint.  Pinpoint will allow users to browse and purchase applications and services for Microsoft platforms.  I suspect over the coming months partners will be jockeying for position on this new site.

 

All in all, these look to be very exciting developments indeed.

More Posts Next page »