News for hackers. Stuff that matters.
Re:Frege: A JVM pure functional programming language in the ... by cgh on Thursday November 07, 2013 @12:49PM (#6690943)
Another difference not mentioned is given the use of recursion in Haskell and the JVM's lack of tail-call optimisation, I have to wonder how dangerous this is. I know Clojure has recur (I'm not a Clojure programmer) but unless Frege has something similar, I predict many an exploding stack.
Re:Frege: A JVM pure functional programming language in the ... by cgag on Thursday November 07, 2013 @01:02PM (#6691051)
Re:Frege: A JVM pure functional programming language in the ... by dustingetz on Thursday November 07, 2013 @03:49PM (#6692281)
It can compile to a loop. JVM can't optimize it for free at runtime. Scala has tail recursion elimination
Re:Frege: A JVM pure functional programming language in the ... by bunderbunder on Thursday November 07, 2013 @08:36PM (#6693876)
What about tail calls for mutually recursive functions? My understanding is that Scala is not able to do tail call elimination in this situation. So the only situation where you can be sure that deep recursion won't overflow the stack is when a function is tail calling itself.

If Frege isn't able to do any better with mutual recursion then that might be a severe limitation on its utility. Scala users can work around the issue by writing loops manually. In a pure language, not so much.

Re:Frege: A JVM pure functional programming language in the ... by voxfrege on Friday November 08, 2013 @05:03AM (#6695397)
Frege can handle mutual recursion.

The only problematic point is recursion through a strict function argument, like in:

    length (x:xs) = 1 + length xs
Re:Frege: A JVM pure functional programming language in the ... by Locke1689 on Friday November 08, 2013 @01:31AM (#6694788)
Scala provides trampolining via a library. Frege can do the same.
Re:Frege: A JVM pure functional programming language in the ... by anonymoushn on Thursday November 07, 2013 @06:40PM (#6693334)
Please, scalac performs TCO in fewer cases than g++. Some JVMs are able to perform TCO, which is nice since scalac won't do it.