Live data from Hacker News

Fjord – F# programming language for the JVM

github.com

11–20 of 62 posts

Re: Fjord – F# programming language for the JVM

#13
post #11

How is this supposed to work given the JVM does not support tail calls?

Maybe someone who knows Scala or Clojure internals can answer this question..

scala 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).

Re: Fjord – F# programming language for the JVM

#15

Since 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/ (It's essentially what it says in the tin...)

Or scala, which is an acceptable ML if you ignore the OO parts :-).

Re: Fjord – F# programming language for the JVM

#16
post #13

Earlier quoted context omitted.

Maybe someone who knows Scala or Clojure internals can answer this question..

scala 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).

Support 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.

Re: Fjord – F# programming language for the JVM

#17
post #4
post #2

Very 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.

F# has an open-source compiler and runs well on non-microsoft platforms using Mono. How is it tied to the MS platform?

What'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?

Re: Fjord – F# programming language for the JVM

#18

To 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…

Perhaps of more interest is Frege, which is basically Haskell for the JVM. Seems to be coming along nicely: https://github.com/Frege/frege

Re: Fjord – F# programming language for the JVM

#19
post #17
post #4

Earlier quoted context omitted.

F# has an open-source compiler and runs well on non-microsoft platforms using Mono. How is it tied to the MS platform?

What'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?

There 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.

Re: Fjord – F# programming language for the JVM

#20
post #5
post #3

How does mono's F# coverage compare to this?

F# 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

FYI, 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/

Post reply on HN