Question

I took a look at some new languages for JVM. Two of them are gathering much interest these days: Clojure and Scala. But in my humble opinion, both of them are not ideal. (Let's keep it a speculation, cause I don't want to damage myself discussing..)

What I actually see as a tricky move is MS's invention - F#. Simply moving the OCaml language to .NET platform yield somewhat awesome.

The question is: Did someone manage to write a full-featured OCaml compiler for the JVM? What would you say if that's a good idea?

Was it helpful?

Solution

"OCaml and Java" has links to various attempts to integrate Java with OCaml.

F# is somewhat different from OCaml in aspects due to the desire to have it work with the .NET framework, so, much as Scala is a hybrid language, so is F#, as you can pick and choose how much FP you want and how much OOP you want, in either language.

"Java, OCaml, and F#" is a post from someone trying to move from Java to OCaml which you may find interesting.

OTHER TIPS

How about Cafesterol: http://cafesterol.x9c.fr/

Cafesterol is an extension of the Objective Caml compiler suite that generates Java bytecode. Cafesterol provides an ocamljava compiler that is the Java counterpart of ocamlc/ocamlopt compilers distributed with the Objective Caml standard distribution. Cafesterol, in its 1.3 version builds with the 3.11.1 version of Objective Caml. The produced Java classes need the 1.3 version of Cadmium to run and can be executed on any Java 1.6 virtual machine.

Yeti is (while syntactically a bit different and extensions for Java-Integration) in both the constructions and typesystem it is based on ML like Ocaml. Because of its powerful support for (recursive) record-types I think its currently the one which comes closest to Ocaml.

Sort of F# for the JVM.

http://mth.github.com/yeti/

Ocaml-Java is as close to an "official" OCaml for the JVM as you can get. It seems to be very high quality.

(Also, Haskell for the JVM: Frege)

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