7 ms·
Fjord – F# programming language for the JVM
- lmm 13y agoVery pleased to see this. F# is a really exciting language, hamstrung by being tied to the MS platform. Hoping we'll see more opensource F# projects as a result.
- thomasbk 13y agoF# has an open-source compiler and runs well on non-microsoft platforms using Mono. How is it tied to the MS platform?
- aartur 13y agoSome examples of why .NET is a Windows technology: http://www.mono-project.com/Guidelines:Application_Portability http://www.mono-project.com/Guidelines:Application_Portabili...
- gokhan 13y agoNo. Those are examples of portability issues when your application depends on platform specific functionality: Most code containing P/Invoke calls into native Windows Libraries (as opposed to P/Invokes done to your own C libraries) will need to be adapted to the equivalent call in Linux, or the code will have to be refactored to use a different call. <-- Means when you choose to directly link to Windows technology. Registry <-- If you choose to use it. I haven't written any registry dependent code for the last ten years and don't even miss anything about it. you should not assume the order of bytes <-- Not .Net's problem. ... the list goes on.
- melling 13y agoWhat's the quality of code produced by Mono? How does it compare with Microsoft's compiler? I'd like to see Mono C# and F# numbers compared against Microsoft's compilers. Will I get 90% of the performance?
- giulianob 13y agoThere are games running on Mono (e.g. Unity C# scripts, Bastion was ported to Mono to run in Chrome, etc..). I'm sure the performance of Mono may depend on your specific application but many people have been using it without any issues.
- melling 13y agoMono has been out for years, and I'm sure there have been great improvements. Does anyone have recent comparisons of it vs C# on Windows? I'm sure people must be curious.
- and21OS 13y agothe c# performance over mono is really different to the f# performance..while c# has a decent performance on mono, f# doesn't performance so well......
- Paradigma11 13y agoDo you have any links with benchmarks? Very interesting.
- profquail 13y agoYou can run F# on the old "stable" branch of Mono (2.10.x), but I'd highly recommend running Mono 3.0.x instead. The older version uses an older, simpler GC which works OK for C#, but which seems to have trouble with F# (which generates more G0 objects than C#). The new 'sgen' GC in Mono 3.0 is a huge improvement though, so you shouldn't see much (if any) performance difference between F# and C# apps.
- rayiner 13y agoDepends on what you're doing. Mono 3.0 has a stable llvm backend. For low level code it should run as fast as c modulo array bounds checks etc.
- and21OS 13y agoit's tied in the sense than the madurity over mono is a really long distance over the net one...I try use mono and f# in win xp..the answer was.."you can't...install w7 and vs2012"...that is annoying...the "mono community" are only a few guys compared to the .net support...so yes...it is really tied to .NET.....
- fooooobar 13y agoWhy not just use OCaml then?
- niggler 13y agoHow does mono's F# coverage compare to this?
- Lewix 13y agoF# works very well on Mono. You can compile and use the open-source edition of the F# compiler [1] on both Linux and on OS X (though I haven't tried OS X). This port is in very early stages, and only has the start of a lexer as far as I can see. [1] https://github.com/fsharp/fsharp https://github.com/fsharp/fsharp
- profquail 13y agoFYI, F# 3.0 is shipped as part of the Mono package for OS X. It's also available through the FreeBSD ports system: http://www.freshports.org/lang/fsharp/ http://www.freshports.org/lang/fsharp/
- profquail 13y ago(Replying to myself, since I can't edit the post now...) More info on F# 3.0 + Mono 3.0 + FreeBSD can be found here: https://groups.google.com/forum/?fromgroups=#!topic/fsharp-opensource/lKLFxHq4oc8 https://groups.google.com/forum/?fromgroups=#!topic/fsharp-o... Arch Linux users: the thread I linked also has instructions on how to build/install F# 3.0 and Mono 3.0, if you're interested.
- 7sharp9 13y agoF# works very well in Osx and with Xamarin Studio you can target a lot of different platforms: Windows, Osx, Android, and iOS.
- jstclair 13y agoHas anyone tried running the F# through IKVM[1] (.Net <-> java)? That wouldn't solve this, but it should be possible to run F# on a JavaVM. [1] http://weblog.ikvm.net/ http://weblog.ikvm.net/
- daeken 13y agoIKVM runs JVM code on .NET, not the other way around.
- skrebbel 13y agoThat may not be a practically relevant difference. Why would you want to run F# on the JVM? To interface with JVM code. IKVM lets you do that already. I've rolled out multiple .NET programs that contain Java open source libraries through IKVM. It works just fine, and the amount of extra work you need to do to make the JVM->.NET mapping work is remarkably little.
- lucian1900 13y agoOr perhaps you'd wish to run F# on the JVM because you like the language, but don't wish to depend on .NET (or Mono).
- kvb 13y agoNot quite the same, but you may be interested in the IKVM type provider prototype[1], which allows you to write F# scripts directly against JAR files (using IKVM in the implementation). [1] http://colinbul.wordpress.com/2013/02/28/f-ikvm-type-provider/ http://colinbul.wordpress.com/2013/02/28/f-ikvm-type-provide...
- Raphael_Amiard 13y agoTo save anyone the trouble, this project is totally empty yet. It doesn't say anything about the ability of the owner to port F# to the JVM, but just know that it is just a readme, three almost empty java classes, and the beginning of an ANTLR parser. So to answer other questions here, you can't even compare it to F# on Mono. F# on Mono works perfectly. The F# compiler and runtime is huge, and getting to parity will probably take at least a year to a very dedicated team.
- quasque 13y agoPerhaps of more interest is Frege, which is basically Haskell for the JVM. Seems to be coming along nicely: https://github.com/Frege/frege https://github.com/Frege/frege
- octo_t 13y agosurely you could just run lljvm on the llvm IR that ghc emits and have haskell code on your JVM?
- th0ma5 13y agocould you get the kind of adhoc library interop you get with other on-the-jvm languages like this with llvm?
- carterschonwald 13y agoprobably not if you did it this week :) That said, there is some very interesting work going on towards having a sane call out to JVM / .net code from haskell, though nothing will realistically be in a truly usable for in the next 12-18th months
- voxfrege 13y agoI am not so sure if Frege would be of interest for people that look for an impure, strict language. A better fit for that would be Yeti. And assuming that porting a language that is so deeply rooted in the .NET world like F# is very difficult, my guess is that going with Yeti and thus fully embracing the JVM will be a better choice. The more so as one could do this right now.
- lysium 13y agoHow is this supposed to work given the JVM does not support tail calls?
- moondowner 13y agoMaybe someone who knows Scala or Clojure internals can answer this question..
- fhars 13y agoscala doesn't optimize general tail calls, either (only direct tail recursion of final methods). If you want to optimize tail calls on the JVM, you must use trampolining, which adds some overhead to every call. So most languages choose fast calls without tail call elimination over slower calls with tail call elimination (i.e., speed over correctness).
- happy_dino 13y agoSupport for tail calls pretty much depends on the actual runtime implementation. If it is important to you (it certainly is to me), use an implementation which supports proper tail calls. I'm doing it and I have never looked back.
- cantankerous 13y agoOut of curiosity, which implementation are you using?
- happy_dino 13y agoHave a look at http://oss.readytalk.com/avian/ http://oss.readytalk.com/avian/.
- cantankerous 13y agoThis is very cool. Thank you!
- jon_smark 13y agoSince F# was derived from OCaml, I think readers may also be interested in taking a look at the OCaml-Java project: http://ocamljava.x9c.fr/ http://ocamljava.x9c.fr/ (It's essentially what it says in the tin...)
- fhars 13y agoOr scala, which is an acceptable ML if you ignore the OO parts :-).
- kvb 13y agoIt's really not. Scala is a very interesting language, and it incorporates many functional features, but it's not at all ML-like. In particular, type annotations are needed in many, many places where they would be superfluous in an ML-derived language.
- mafribe 13y agoAs a recent migrant from Ocaml to Scala (due to stagnation of Ocaml), I have to say that you are quite right about type-annotations, but the style of programming that an Ocaml/F# person would be accustomed to is quite easily replicable using Scala.
- and21OS 13y agoyep..I change from f# to scala and actually know many developers doing the same change...scala in first instance looks more verbose but actually it's much more powerfull (higher kinded types, scalaz, macros,etc) actually after accustom the syntax you find a clear and concise language (with ugly type annotations)
- jon_smark 13y agoWhat do you mean by "stagnation of OCaml"? There was a period some 4-5 years ago where it did seem like there was little development on the language, but things have changed quite a lot since then. Lots of developments in the core language (including first-class modules and GADTs!), and a blossoming of the ecosystem around it. To me, it seems OCaml has never been livelier than now...
- kawas44 13y agoF# <- Ocaml <- ML language Have a look at Yeti ? http://mth.github.com/yeti/ http://mth.github.com/yeti/
- jackfoxy 13y agoThere is a good technical thread started on stackoverflow http://stackoverflow.com/questions/15731724/whats-the-easiest-way-to-build-an-f-compiler-than-runs-on-the-jvm-and-generate http://stackoverflow.com/questions/15731724/whats-the-easies...