Menu

Running F# on a PlayStation Vita

At the progressive F# hackathon yesterday I set myself the task of getting something written in F# running on a PlayStation Vita. It’s something that I’ve wanted to do for a while now and thought there was no better time to try it. Here’s the results running on an actual device which is always a bit more impressive than just running it within an emulator.

The first thing you’ll need is a Mono compatible version of FSharp.Core 4.3.0.0, the quickest way I found to get this was to download the fsharp_30 branch of the fsharp tools from http://github.com/fsharp/fsharp and in the FSharp.Core.fsproj add the defined symbol CROSS_PLATFORM_COMPILER. I also removed the listed references and instead added those provided by SCE in C:\Program Files (x86)\SCE\PSM\mono\lib\mono\2.1 and then run the fsharp-library-build.proj file with MSBuild

Create a new F# library project (I did this in Visual Studio)

Remove all of the references. Add a reference to FSharp.Core which you just built. Add a reference to all of the Sce.PlayStation dlls listed in C:\Program Files (x86)\SCE\PSM\mono\lib\psm Add references to System.dll and mscorlib.dll as provided in C:\Program Files (x86)\SCE\PSM\mono\lib\mono\2.1

Delete all of the files in the project and add a new file called game.fs replace it with the following code