Friday, 13 April 2007

Stochastic Pi-Calculus

I had a fascinating meeting yesterday with some of the guys at Microsoft Research Cambridge. In particular, I was introduced to the "stochastic pi-calculus" for the first time:

Despite the scary-sounding name, this is actually a very elegant and simple approach to simulating "population", in this case the populations of different species of biological molecules in an organism.

A system is defined by a flow chart that gives the rates of transitions between states (e.g. the rate of production of a protein). The simulator takes chooses from the possibilities at random, resulting in a Monte-Carlo simulation that is faster than a discrete time simulator and more accurate than a simple symbolic solution.

The applications for such a generic simulator are very diverse. Some obvious ones are chemical reactions in chemistry and ecosystems in population biology. However, the package needs a user interface overhaul if it is going to be used by working scientists.

We were discussing the prospect of using the 2D vector graphics engine that I have been developing over the past decade and it occurs to me that many people in the F# community could benefit from this functionality and I could sell the library. If you're interested in buying visualization tools from us them please comment on this blog entry and let me know what you need. I already have quite a repository of software and it is about time I started releasing products based on F#, given the current explosion in the number of F# users.


Alan said...

I just read a paper I really liked that is tangentially related. You should really check out: Generative Code Specialisation for High-Performance Monte-Carlo Simulations.

They used Haskell to generate specialized C code to perform the inner-loop of some extremely long-running monte-carlo simulations. The result: it runs faster than the commercial tools and its written with high-level code!

Jon Harrop said...


The F# team are actually beavering away on heterogeneous metaprogramming for F#. They are targetting the run-time generation of GPU code as well as C code.

I've actually been asking them to to add on-CPU metaprogramming capability similar to MetaOCaml. From my point of view, this is desirable because it is robust (no external dependecies) and that is interesting because you can farm out self-contained .NET programs using something like Alchemi to exploit massive parallelism.

I'll check the reference out. Thanks!