Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
question about the jvm backend
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
forum@x9c.fr  
View profile  
 More options Jun 17 2010, 3:29 pm
Newsgroups: fa.caml
From: "fo...@x9c.fr" <fo...@x9c.fr>
Date: Thu, 17 Jun 2010 19:29:23 UTC
Local: Thurs, Jun 17 2010 3:29 pm
Subject: Re: [Caml-list] question about the jvm backend

Le 10 juin 2010 à 16:27, Martin DeMello a écrit :

> I have an OCaml implementation of an algorithm that I now want to use
> from clojure. As I see it, my options are:

> 1. Port to clojure
> 2. Port to scala (better support for pattern matching will make it
> easier to port, also scala might be faster)
> 3. Recompile the OCaml code against the JVM

> (3) seems like the easiest choice, but from what I could gather from
> the docs, there is not much support for generating a library that can
> be consumed by a main program in another language. Is this going to
> change in 2.0?

Well, there are indeed two ways to call OCaml code from another JVM language:
  - by callbacks;
  - by scripting.

Callback from a JVM language work similarly to callback from C to
either ocamlc- or ocamlopt-compiled code. This is described in the
fourth chapter of [1], original callbacks being described by the chapter [2].
However, beware that the representation of OCaml values is going
to change in the upcoming 2.0 version of OCaml-Java.

Scripting is based on the "javax.script" package introduced by JDK 1.6.
It allows to execute arbitrary OCaml code, and can call OCaml compiled
code. It is slower than callbacks, as the script code has to be compiled
at runtime.

Finally, here are some key points that may help you making up your mind:
  - performance in version 2.0 should stand between ocamlc and ocamlopt;
  - version 2.0 will be based on JDK 1.7;
  - hopefully an alpha version should be released during summer, with the
    goal of having a stable version by the end of the year (current target of
    JDK 1.7 release).

Feel free to ask for further explanations if needed.

Regards,

Xavier Clerc

[1] http://cadmium.x9c.fr/distrib/cadmium.pdf
[2] http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Wong-VanHaren  
View profile  
 More options Jun 18 2010, 4:54 am
Newsgroups: fa.caml
From: Mark Wong-VanHaren <mark...@gmail.com>
Date: Fri, 18 Jun 2010 01:54:07 -0700 (PDT)
Local: Fri, Jun 18 2010 4:54 am
Subject: Re: question about the jvm backend
On Jun 17, 12:29 pm, "fo...@x9c.fr" <fo...@x9c.fr> wrote:

> Le 10 juin 2010 à 16:27, Martin DeMello a écrit :

> > I have an OCaml implementation of an algorithm that I now want to use
> > from clojure. As I see it, my options are:

> > 1. Port to clojure
> > 2. Port to scala (better support for pattern matching will make it
> > easier to port, also scala might be faster)

In my estimation, porting to Scala is a good option, for both reasons
you state.  Scala's pattern matching, partial application, etc. is
fairly similar to OCaml's.  And Scala's likely to run faster than
Clojure, even with type hints.

Cheers,
-m


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »