A friend of mine, Darren Platt, has been writing a genome viewer in F#. Here's some things he had to say, followed by a question which I thought I'd open up to the forums. It's really a very cool app and I'm thrilled that Darren's using F# for such great things.
Hey just got my viewer up and running with mouse interaction thanks for some of your code snippets. It's the fastest genome assembly viewer I've ever seen and only 500 lines of F#. It's really an incredible language Don, you've done a really good job.
Here's the question. I've taken a stab at answering the question below, but if there are people who are more familiar with DirectX, installers, ClickOnce etc. etc. then please chime in.
Do you have any thoughts/experi with distributing F# binaries. I would actually like to start giving this to people to use (it's already incredibly useful) and there is a reasonable stack of dependencies (other .net dlls eg. database connector, FSharp libraries, dotnet installation, directX). Is there a sensible path for doing this or should I just ask my users to install all of those things first into standard places (the random and varying import parts for different versions of directX are annoying for example). I'll send you the demo once I get over this hurdle, it loses a bit in the screenshot, but basically with very fast and smooth zooming/scrolling it's really pleasant to use. My current tool for doing is a python CGI script that produces nice images but which is completely non-interactive and very slow.
Darren - given the DirectX dependency I would do this
- Note the version of the DirectX Runtime (not SDK) that you're using
- Statically link the F# code using --standalone. You will have to add a reference to some other assemblies that form part of the transitive closure of assemblies. Jon Harrop just did this for his DirectX raytracer. This will give you a binary ~1MB - you can make this much smaller by running the tool "iltrim.exe" in the latest distributions (not yet publicly released, but I know you have a copy I sent you for testing)
- Tell your users to install .NET 2.0 and the given version of the DX runtime (give them links to the MS downloads). If you depend on a non-standard database connector then probably just ship that DLL alongside your binary.
That should give you an app people can run. Next:
- Once you're satisfied you know how the dependencies work out on a clean machine (Virtual PC is a great tool for this), you might build an installer with Visual Studio 2005, or if you like more control then I recommend WiX.
- There are ways to ensure that your app is "ClickOnce", i.e. it will direct users through to Microsoft and other sites for the relevant components. I haven't shipped an app like this but I'm sure others on the site know lots about that.