Monday, April 21, 2008

Designing F# Programs

I've been working on a project in my spare time for a presentation I am going to give at Atalasoft this next friday. I am going to try to recreate Rich Hickey's Clojure ant colony simulation except in F#.

I have run into a number of issues along the way...

First of all, by default F# has no Software Transactional Memory. There is a non-integrated library for it, but i'm not sure I want to step outside of normal F# territory for this demonstration. I think I may just lock on the map nodes while an ant is moving or getting food instead. Although this may not demonstrate highly concurrent functional programming as well.

Secondly, at this point I think I have a good feeling for how to write small code blocks in F#. What I am struggling most with is program structure and message passing. My UMass Scheme course didn't really educate beyond how to write scheme in scheme and none of my traditional object oriented techniques are in play here. The best I can do is try to mimic existing programs.

Third, I'm not very familiar with the windows drawing calls. I'm not too worried about this though, there are tons of examples out there. The hardest part will be shoe-horning them into F#'s functional style.

-Rick