OCaml for JVM. Is there any? [closed]
Asked Answered
O

4

18

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?

Outrelief answered 8/10, 2009 at 13:8 Comment(0)
E
14

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

Espagnole answered 8/10, 2009 at 13:39 Comment(7)
Thanks, James. I didn't know that F# doesn't copy OCaml.Outrelief
They are very similar, and if you are careful your OCaml source should work in F#, but they extended F# for .NET.Espagnole
just because i'm curious, in what cases the ocaml code doesn't work as F# ?Khedive
Monomorphic types, Functors, Structural subtyping, Polymorphic variants, Recursive types, Recursive modules, Typesetting (the Format module), Macros (camlp4), Non-int numeric literals in patternsMagel
@LB - Here is a thread that dealt with your question: https://mcmap.net/q/173040/-f-changes-to-ocaml-closedEspagnole
Specifically, the Cadmium project in the list on Cocan looks highly relevant to Bubba88's needs.Sorcha
There were different projects taking different approaches, one may work better, and there may be an approach that is more ideal that wasn't shared with us. I liked that list, I thought it was well-done.Espagnole
U
12

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.

Uncommon answered 23/10, 2009 at 0:26 Comment(1)
Last history entry is "Version 1.4 (2010-02-06)" ;_;Blubbery
E
4

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/

Eighteenmo answered 13/3, 2011 at 10:9 Comment(0)
T
4

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)

Territus answered 24/1, 2015 at 19:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.