TP

# Recording and samples from my Reactive F# talk

Almost a week ago, I posted an invitation to my F# talk at the F#unctional Londoners user group. The theme of my talk was reactive programming, which was also a topic of my Master's thesis (defended earlier in June), so I really enjoyed talking about it. In the talk, I discussed the two approaches that you can use for developing reactive applications in F# (using examples in Silverlight):

• Declarative (or data-flow oriented) allows you to describe "what" should be done with data that your component receives from various events (such as mouse position etc.) This can be written using F# event combinators such as Event.map and Event.scan.
• Imperative (or control-flow oriented) - in this style, we describe various states of the component (e.g. semaphore with green, orange and red) and describe transitions between the states. This can be written using F# asynchronous workflows and the AwaitObservable primitive (which you can get as part of the source code).

Thanks to the folks from SkillsMatter who provided place for the meetup and helped with the organization, the talk was also recorded and is already available online! Below, you can also get all the nice Silverlight demos that I used during the talk...

Thanks again to Carolyn Miller and Phil Trelford for organizing the talk and also to Don Syme for taking me to the airport in the early morning (at 4 AM...) after the talk.

Published: Sunday, 27 June 2010, 2:49 PM
Tags: universe, presentations, functional, f#, links

# Reactive Programming with F# in London

If you’re a registered member of the F#unctional Londoners user group, then you maybe already know that I'll be visiting London on June 23 and I’ll be talking about Reactive programming with F#. If you're not a registered member and occasionally visit London, then you should definitely register. The user group is organized by Carolyn Miller and Phil Trelford (whom I met some time ago at Microsoft Research in Cambridge). Among others, previous speakers include Robert Pickering (who also presented some samples based on my F# and Accelerator series). Finally, another reason for joining the group is that it has a great name (as well as a logo)!

## When, what & where?

By the way, I'll also have a free copy of my Real-World Functional Programming book to give away during the talk!

## Reactive Programming with F#

I'm sure you're already convinced to come. Nevertheless, you may still want to know what I'm going to talk about. There are many areas where F# offers clear benefits such as parallel & concurrent programming. I believe that reactive programming is another great area for F#. In reactive programming, we face quite different problems than in other programming styles. We (as the authors of the application) can no longer specify what the application should do. Instead, the application needs to be able to handle many possible combinations of events. This aspect of programming is sometimes called inversion of control.

Reactive programming is important for programming user interfaces, especially today when user interfaces are becoming more interactive and more "fancy". To demonstrate this, I'm working on some nice Silverlight demos for the talk! However, it is also needed to handle other kinds of events such as completion of background task or message from other application. We'll look at the two essential techniques that F# provides for reactive programming:

• Declarative event combinators - one way of writing reactive applications is to specify the whole event processing declaratively by saying "what" should be done with occurrences of events. This is particularly useful when we need to encode simpler logic with a clear data-flow.
• Imperative using workflows - for more complicated interactions, we can use asynchronous workflows. This makes the code more explicit, but we get full control over the control-flow of the application. Even though this approach is more "imperative" it can be used for writing nicely composable functional code as well.

I'm looking forward to seeing you at the talk next week!

Published: Tuesday, 15 June 2010, 2:54 AM
Tags: functional, random thoughts, universe, f#