Sunday, August 02, 2009 11:57 PM
by
RickM
Discoveries This Week 08/02/2009
Tomorrow Matthew Podwysocki will be speaking at the New England F# User Group. I also have some great links today with Don Syme at QCon08, why we need the rec keyword, regular expression parsing and graphing with GLEE.
With the increasing amount of data available to us, we need new ways of thinking around how to create scalable solutions in order to best exploit it.
I’m a long time fan of Matt’s blog and am looking forward to see him speak. We’ve gotten most of the bugs out of our video workflow and so I hope to have his talk up on the New England F# User Group site early this week.
Don Syme presents F# basics, a typed functional language for .NET that combines the succinctness, expressivity, and compositionality of functional programming with the runtime support, libraries, interoperability, tools, and object model of .NET.
I’m always happy to find another instance of Don Syme speaking. In this talk he focuses on why functional programming is worth Microsoft’s investment in time.
One of the first things that I noticed is that in order to declare a recursive function you have to be explicit about it in the function definition. You have to declare it with the rec keyword. […] But I don't know why they didn't do this by default.
Interestingly enough, it turns out that the reason for the rec keyword is required is due to the way Hindley-Milner type inference algorithm handles mutually recursive functions. Without the keyword the algorithm would be unable to generalize types appropriately.
One of the habits of a good functional programmer is to use tail-recursion. This allows the compiler to convert recursion into iterative methods that can handle any length of input. I have attempted to use this. […] I have also structured the code into modules to demonstrate some of F#’s features in this regard.
Beautifully structured code for a first stab at F#.
In my previous post, I described how to parse a regular expression pattern into an abstract syntax representation. The next phase is to transform the parsed syntax into a finite state machine. I have chosen to model the FSM as a mathematical directional graph (digraph). This post describes the implementation of this module in preparation for the actual compilation step.
Another excellent couple of samples from Steve. I had not seen GLEE in the past and have had a number of projects in which it would have been quite useful.