Which JVM functional languages are well IDE-supported? (IDE: IDEA, Netbeans, Eclipse or similar)
Asked Answered
A

4

15

I have spent much time looking for a functional language that can seamlessly access Java legacy code (Weka code). Autocompletion of imported Java class methods would be excellent. I will present my impressions, please correct me if I am wrong.

Yeti is very appealing to me because it is simple and ML-like, but I couldn't setup a good IDE for it. I don't know also if the language itself is already usable in real life.

Groovy, JRuby and Jython seem very mature, but are not really functional. Scala is mature but is OO also and at least on Netbeans (and Eclipse if I remember well) it is buggy.

"OCaML-Java" is OO also and doesn't come ready to use (3 or 4 separate projects). I suppose that in IDEs it would be even less ready to use.

Jaskell appears to be dead.

Clojure seems mature and works really well in Intellij IDEA (La Clojure plugin), but I am not sure I want to write more than 2 parens per line while coding.

SISC and ABCL I didn't try. I think there is no IDE support.

CAL (or Quark ... Blah ...) language leads to a SAP site and after that my patience searching for functional JVM languages ended.

There are similar questions but not comprehensive. For instance: Which Functional programming language offers best support in Eclipse?

Is some JVM functional language that is capable to call java classes directly missing? If Yeti had IDE support as Clojure has (in IDEA), it would be perfect to me.

Thanks

EDIT-----------------------------------

I could use Clojure+Scala in Intellij IDEA. Example of interoperability:

Scala code

package a
class ScalaMain {
  def test = {
    "testing!"
  }
}

Clojure code

(import '(a ScalaMain)) ;'
(def scalainstance (new ScalaMain))
(print "printing: " (. scalainstance test))

Spectacular!

Allophane answered 28/7, 2011 at 9:58 Comment(1)
Tutorial for Scala+IDEA: confluence.jetbrains.net/display/SCA/…Allophane
T
10

Scala + eclipse IDE (latest version) http://www.scala-ide.org/ seems to be getting better and better. Same for the IntellijIDEA plugin. There are lots of people/companies now developing with Scala... I don't think they all use Text Editors only.

I think that the most FP languages at the moment are Scala (multi-paradigm) and Clojure (pure functional) What is wrong with Scala being OO?

You can expect new languages comming such as Kotlin and Ceylon having functional features as well but they will also be OO, so I think your only choice now is between Scala and Clojure.

From your list you missing Fantom language. It also has Functional features, but I think it lacks IDE support (or atleast it is not updated to the latest versions)

UPDATE: There is now an eclipse-based IDE for the Fantom programming language that looks really nice. You can find it here: http://www.xored.com/products/f4/

Thanksgiving answered 28/7, 2011 at 10:25 Comment(6)
I saw Fantom only after posting. The first downside is the Java-like syntax.Allophane
Java-like syntax applies to Scala as well. Clojure creator Rich Hickey has a strong opinion against OO model, you might be interested into hear it.Incarnation
@Incarnation Ok, Fantom and Scala syntax are similar, but I didn't get the point of Fantom whatsoever. A difference I could find is about jobs: indeed.com/…Allophane
Back in May 2011, I found mixed Java and Scala did not work very well in eclipse - lots of false errors when referencing types. For pure scala projects, it seems ok. We switched to IntelliJ and with the same maven projects, the reference problems went away and are on the whole pleased with it. You do get the occasional hang, or slowness. So currently, there is no perfect mixed Scala/Java IDE yet, but IntelliJ is currently my favourite.Letta
Just another note from me as from another Scala-hater : IDE is not main thing you need to care about. JRuby or Clojure got great IDE support too. But the syntax! That is what really matters. The main language point is syntax. I will strongly recommend to check Scala syntax twice before you chose it :)Para
Two years follow up... I have seriously tried Scala and Haskell. A bit of Clojure also, and it is really nice. But for some reason I don't remember, may be the '()'-bound syntax, I went with Scala. Haskell doesn't have Java interop, what was important at the moment. All I can say is: a subset of Scala is great to use if we keep ignorant about the rest of the language concepts. Otherwise it is an endless fight against language complexity. Oh, and you have to write List() to every list you create! :)Allophane
S
4

Clojure is excellent when it comes to java interoperability + functional + having advantages from lisp. Though other IDE's support clojure , emacs works really well except that it takes time to learn and get used to emacs way of coding.

Stereotomy answered 29/7, 2011 at 4:21 Comment(0)
A
2

Clojure's interop story is fantastic. A major win with clojure is that its collections all implement the interfaces that come in the Java collections API, you don't have to adapt Clojure collections or copy them to Java collections to pass them to Java code as long as the Java code does not modify their contents. The reverse is also true, Java collections can be used with many of the Clojure functions that are useful like map reduce filter etc... I know somebody who ditched Scala for Clojure for this reason amongst others.

Its also easy to write Java interop code in Clojure that uses fewer parens than you would use in the equivalent Java code.

e.g.

blondie.callMe().callMe().any().any().time();

(-> blondie .callMe .callMe .any .any .time)

It takes some getting used to, but if you think about it, its not really all that different. Compare the following line of Java code v.s. Clojure, I think you'll understand both.

System.out.println("Hello World");

(println "Hello World")

Discounting the qualification of System.out and the additional semi-colon in the Java example, the only real difference is that the paren is now in front of the function call. Crazy talk!

It is different, but it may not be as bad as you think, and if you give it a try you might find compelling benefits in the language. If you want IDE support, check out LaClojure in IntelliJ or Enclojure from Netbeans. I know that Enclojure offers good completion support, which I think is really mostly only useful if you're dealing with lots of Java. Performing without a net in Clojure works fine.

Acrid answered 15/1, 2012 at 2:48 Comment(0)
S
1

Frege has now also a (still very basic) eclipse plugin.

Sesquioxide answered 15/1, 2012 at 1:55 Comment(2)
Could you compare Frege and Yeti please? If I understood, Frege is pure. Maybe it comes with all the complication I dislike in Haskell.Allophane
@davips - Well, Yeti is strict and not pure, Frege is non-strict and pure. I cannot say more here because of space restrictions and not knowing Yeti well. Regarding Haskell complications, you may want to check the brief differences Haskell/Frege code.google.com/p/frege/wiki/DifferencesFregeHaskell, maybe you find your points adressed, if not you can also drop me a mail (find my mail adress on the frege project page).Sesquioxide

© 2022 - 2024 — McMap. All rights reserved.