Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OCaml for JVM. Is there any? [closed]

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?

like image 860
Bubba88 Avatar asked Oct 08 '09 13:10

Bubba88


4 Answers

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.

like image 27
aneccodeal Avatar answered Nov 16 '22 22:11

aneccodeal


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

like image 146
James Black Avatar answered Nov 16 '22 22:11

James Black


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/

like image 20
chrisichris Avatar answered Nov 16 '22 22:11

chrisichris


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)

like image 27
pron Avatar answered Nov 16 '22 23:11

pron