Sunday, August 08, 2010 2:57 PM
F# Discoveries This Week 08/08/2010
So many links, all well worth your time. I know one thing I won’t be missing is Don Syme’s online talk at C4FSharp on 8/17. It’s great to be part of a language community in which the founder interacts in such a direct way.
This lecture takes the audience from a tiny numerically-robust implementation of a common linear algebra algorithm through several stages of optimization, culminating in a high-performance solution that easily outperforms Intel’s Math Kernel Library. The algorithm studied is QR decomposition, which is commonly used for linear least squares best fit.
There comes a time when you just have to stop working for a minute and take a few moments to enjoy the fruits of your hard labor. For me, one of these moments lately came when I received the author copies of our book, Expert F# 2.0
As Don Syme mentioned in a recent blog post, I've been working to get the five F# templates that have been announced on this blog up on Visual Studio Gallery. I'm happy to say that all are now available.
So far I only tried very basic mocking described in the first post of Richard’s series: faking return value. As I expected, even such a simple operation became a challenge when executed from F# code. I managed to make tests work only for two and half frameworks.
As I said, this is very much work in progress, and there's still a lot to do. I intend to make it fully open source when I finish writing my thesis.
Suffice to say that a segment tree stores a group of intervals on an ordered set, in such a way that all the intervals containing a given value can be efficiently located. Such a query is sometimes called a “stabbing query,” because it’s like sticking a spear through the data and seeing which entries get stabbed.
Today’s post will be old news to experienced F# programmers. Actually, it’s old news to me, relative newcomer that I am. However, it’s one of those things I tend to forget until it jumps up to bite me, as it did today.
And it is this last recommendation on DSLs that carries interesting news for F# because at the end of page 6 it states “Experience seems to show that higher-order programming languages such as F# provide a particularly good basis for domain-specific languages.
This is a surprising and encouraging result not only because it makes F# competitive for an even wider variety of tasks but because it also implies that Microsoft are taking F# so seriously that they are optimizing the .NET garbage collector for it!
One solution is to label things that need to be protected, disassemble the output, run a regular expression to search/replace the accessibility and reassemble.
As I said, when you compare to these other languages in the world of quant, F# appears to be taking an early lead.
The actual algorithm uses brute force to test for palindromicity (neologism?) all the numbers that can be composed multiplying together 3 digits numbers (those from 100 to 999), picking the highest one.