Question

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!

Was it helpful?

Solution

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/

OTHER TIPS

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.

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.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top