Friday, April 09, 2010 1:28 PM
F# Discoveries This Week 04/09/2010
With the Visual Studio 2010 launch just days away, the F# community is exploding with fury and excitement. Come inside and find links to topics ranging from general programming patterns to specific algorithm implementations.
It is with sadness that I mention the death of Professor Robin Milner, the great British computer scientist, who passed away 11 days ago.
This talk describes building Silverlight 3 applications using F#. Both Visual Studio 2008 and 2010 RC are demonstrated.
F# with Michael HaleIn this episode of CodeCast, Ken Levy interviews Michael Hale, a program manager on the F# team at Microsoft. Michael discusses what’s new in F# for both Visual Studio 2008 and Visual Studio 2010, various scenarios for functional programming with F#.
I just wanted to give a quick notice that I got the new compiler for IronJS to run on both .NET 2.0 and Mono 2.6 today, the goal is for IronJS to be able to run on .NET 2.0, 3.x and 4.x plus Mono 2.6
Though the killer app for F# async is non-blocking I/O on the server side, F# asyncs are also useful and fun to use for client-side programming on the UI thread. I’ll show two small examples of F# async lets you do non-blocking loops on the UI thread.
Last time I talked about cool ways to use F# asyncs to help write client GUIs. Today I’ll talk about the killer app for F# asyncs, namely, non-blocking I/O on the server side. Once again, this is material I lifted from a recent talk that Matthew Podwysocki and I gave at TechReady.
The list is not necessarily distinct (some elements overlap) or complete (this is just a list I came up with today), and not every reason in the list will resonate with every reader. But they are all ‘real’ reasons, in the sense that they’re representative of individuals or teams out in the world who are already using F# today.
Let’s take a look at what would be required for us to make the Time Flies Like an Arrow example work in F# using first class events and the Reactive Extensions for .NET on top of WPF. I’ll write it in a pseudo-code to give you an idea of how it should be done.
Imagine you have a need to take one type, which may or may not be a discriminated union, and see if it “fits” inside of another type. A typical case might be whether one discriminated union case would be a possible case for a different discriminated union. That is, could the structure of type A fit into the structure of type B. For lack of a better word, I am calling this “structural similarity”.
In a functional language like F# we can do the same thing without the overhead of having to declare classes and interfaces. We can also do the same thing in C#, but it requires some jiggery-pokery, so I’m going to show you it in F#.
I want to depart from the lofty world of semantic networks for a few posts, in order to investigate the world of bit-based computers. By bit-based computer, I mean one in which the entire state of the computer is based on an ordered set of bits. The computer I describe below was suggested by Digi-Comp I, a classic bit-based computer made almost entirely of plastic, but mine is based on a somewhat different design.
This example illustrates a famous “Gosper hack.” There is apparently some controversy over which Gosper hack merits the title THE Gosper hack. Often that title goes to MIT A.I. Laboratory HAKMEM Item 145. The code below is based on Gosper hack 175 from the same document, which is the one Knuth mentions.
In honor of the day, I present the following short program for calculating the date of Easter. The method is from Butcher's Ecclesiastical Calendar (1876). I present it in the form given in Peter Duffett-Smith's Practical Astronomy With Your Calculator (Cambridge 1981, the 1988 version is still available from Amazon, et al).
In the meantime, here is a first try at general purpose depth/breadth-first search routine. It's not really generic yet, being based on a specific data structure. However, my goal is, over the next few days, to turn it into a nice generic search routine that I can use in a number of applications.
The articles of this series are being updated as the series expand. In particular : corrections were made to errors in the algorithms (an example use sample will be published to show what has been checked against either a spreadsheet application or TA-Lib) and modification of the meta information.
This is part of a series on technical analysis indicators in F#, based on the multi-language TA-Lib. Quick disclaimer : some of these indicators are not verified.
In my last post I provided a start to a distributed hash table (DHT) using F#, the Chord protocol, and .NET remoting. In this post, I'll show how that code has changed due to a migration from .NET remoting to WCF.
First of all, I have to confess that I’ve started to see the light of F# and AST manipulation. Anyway, I’ve created a F# skeleton template for Gold Parser and the Calitha .NET engine.
I would like to mention a question that posed on stackoverflow a year back, with a slight change: Given a function which produces a random integer in the range 0 to 4, write a function which produces a random integer in the range 0 to 6.
Objective was the following: implement simple socket based application that will listen specified port, parse incoming HTTP requests (extract uri from request treating it as file) and return content of specified file. Roughly speaking it should be primitive http server.
One section in excellent article "Patterns of Parallel Programming" is dedicated to idiom "Speculative processing". In brief we can start multiple computation in parallel (utilizing advantages of multiple cores), take first result and ignore others. Unfortunatly F# library doesn't provide builtin primitive for this strategy.
I’ve been writing some documentation on building plug-ins and recently I expanded it to include some Visual Basic examples. That got me thinking, what other languages can we build plug-ins in? So I thought I’d give it a quick try in one of the new fangled languages that people are raving about – F#.
But in order for you to take advantage of all of these fantastic features of F#, you need to understand the basics. In this article, I’ll explain these concepts using vocabulary that you are already familiar with as a .NET developer. I will also show you some functional programming techniques that you can apply to your existing code and some ways in which you are already programming functionally.
This article is taken from the book F# in Action. The authors discuss basics of imperative programming in F# and develop a simple application to show how this type of programming works. They also feature some of the interoperability among languages on .NET platform.
The purpose of this article is to introduce you to the F# language - what it is, it's origins, and how it fits into Visual Studio 2010 RC.
I will not try and summarise [sic] the whole talk here; but will bring out its unifying thought, which is that programming is moving towards a style that emphasises [sic] the “what” rather than the “how” of the tasks it encodes.
A short while ago I posted some code for a C# twitter update. I decided to move the same functionality / logic to F#. Here is what I came up with.
Since the best way to learn programming language is to use it, I tought I could port the EPiServer XmlPageProvider to F#. FSharpPageProvider is my first attempt to accomplish that.
A demonstration of how the inline keyword and statically resolved type variables allow for much more robust type inference.