Friday, January 29, 2010 2:15 PM
F# Discoveries This Week 01/29/2010
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.
“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.”
“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.”
“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.”
“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.”
“This post describes the F# implementation of the <insert data structure here> from Chris Okasaki’s “Purely functional data structures”.”
“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).”
“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.”
“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.”
“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.”
“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.”
“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.”
“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.”
“This lexer allows you to define your regular expression based rules in a very declarative way using F# computation expressions.”
“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.”
“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.”
“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.”
“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#”
“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.”
“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:”