Tuesday, September 29, 2009

F# running on the iPhone

I tried F# on the iPhone (via MonoTouch) tonight.  The trivial hello-world code seemed to work just fine.  I used standalone to build the (trivial) fsharp code:

type Foo() =
  do System.Console.WriteLine("This output brought to you by the note F#");
mono ../FSharp-1.9.6.16/bin/fsc.exe -a Foo.fs

And added a line to instantiate a Foo in FinishedLaunching().

Loaded the resulting dll into MonoDevelop, along with FSharp.Core.dll, and it just worked.  Or at least it worked in the simulator, haven't tried the real device yet.

fsharponiphone

3 comments:

Unknown said...

It should be noted that the F# license is restrictive and doesn't permit this kind of usage

JM said...

directhex - why do you say that? I don't see anything in the license that would cause problems. At least for 1.9.6.16 - there may have been earlier F# versions that used more restrictive licenses.

The F# compiler license isn't one of the MS Research licenses that forbids commercial use, FYI.

Jared said...

I would be shocked if the DLLs generated by any compiler have any license issues whatsover. Even the GPLed GCC doesn't generated GPLed-by-default binaries or shared libraries.