Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# on linux, no prior .NET experience

Since Semptember I've been playing with Clojure, a functional lisp language on the JVM. I used it in a couple of small hobby projects. The language is very concise, simple, but I came to a conclusion that s-expressions are not really for me.

There are other functional languages out there like Scala, Haskell, OCaml, etc, but they seem to be more of academic languages.

As of late I am considering learning F# in my spare time. I got a couple of questions:

  • I am primarily a linux user. I am worried that Mono may be lagging behind.
  • I am doing mostly web-dev in a dynamic language which I am pleased with. I'd use F# for some hobby GUI apps, or simple games. Is there good support for both? Can Mono/F# be used for instance on Iphone or Android devices?

When I was learning Clojure I had little Java experience. This didn't turn out to be a big problem. The Java interop was very easy, and Java as a language is also pretty straightforward, so I had no issues reading up documentation.

  • Is F#'s interop easy enough, and does the lack of .NET/C# knowledge pose a difficulty in using external libraries?
  • Lastly, which resources/books would be adequate for me to learn F# (some functional experience, none .NET/C#)

Thanks

like image 868
markin Avatar asked Jan 29 '11 16:01

markin


2 Answers

There has been a lot of progress on getting F# to work well on Mac and Linux:

  • In November 2010, the F# team announced an open-source (Apache) release of F# source code. The Mono team is planing to integrate it in the next version of Mono (see Miguel de Icaza's blog).

  • Folks from Mono already started working on the integration and they have a version with Mono-style Makefiles, which you can get & build from Github. If you don't want to build F# yourself, you can also use community-created Max/Linux package available here.

  • I created an F# integration for MonoDevelop which gives you pretty good user experience (including tool tips with type information, background type checking and completion).

Regarding interop - F# works pretty well on Mono and should, in principle, run anywhere where Mono works (I would expect Android should work, but I didn't try it). It won't work on iPhone (even though C# works), because there are quite a few limitations in that version of Mono.

like image 76
Tomas Petricek Avatar answered Oct 15 '22 11:10

Tomas Petricek


Mono is good enough if you're not trying to ride on the bleeding edge of the hype wave. F# works well with it.

The .NET interop with C-like APIs, using PInvoke, is not difficult to use. It takes some time if you're binding a huge API, tough.

I believe Mono has some iPhone support and don't know about Android support. But I don't work with mobile programming, so, take this with a grain of salt.

For books my personal favorite is F# for Scientists by Jon Harrop. It covers enough material to be interesting even if you're not into scientific computing and it's extremely well written.

like image 26
Vitor Py Avatar answered Oct 15 '22 10:10

Vitor Py