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
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.
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.
On Ubuntu, at least, you'll want to compile Mono 2.8.2 and F# yourself.
I have Expert F# 2.0 and it is good, too, but I've found that all the other books' authors are active on Stack Overflow!
So far I've used far less C#/.NET with F# than I've had to use Java stuff with Clojure, actually.
F# is very much a Cathedral right now, but it is pretty...
精彩评论