ocamljava icon indicating copy to clipboard operation
ocamljava copied to clipboard

OCaml 4.02.X support

Open struktured opened this issue 9 years ago • 19 comments

Would be excited to use the ppx_tools lib, which depends on 4.02.0 or higher. Is there a road map for upgrading the ocamljava compiler version?

struktured avatar Mar 11 '15 16:03 struktured

My goal is to release an alpha3 version during March; this release will be focused on libraries (enhancement of javalib, partial rewrite of concurrent), documentation, and will feature some bugfixes.

Then, I will work on the runtime library and the update to 4.02.x. Hopefully, this should be released in April/May.

xclerc avatar Mar 11 '15 17:03 xclerc

Great, thanks for the quick response on this!

struktured avatar Mar 11 '15 17:03 struktured

Hi. Any news on that?

pron avatar Sep 30 '15 08:09 pron

Unfortunately not. I got a new job in a start-up company (February), and the bad news is that it is really time consuming... The good news is that the aforementioned start-up will use OCaml-Java in production. Moreover, the codebase would benefit from annotations, so there will be a strong incentive to allocate some of my time to the upgrade to 4.02.x.

xclerc avatar Oct 13 '15 12:10 xclerc

Did anything ever come of upgrading the system to use 4.02.x? And if so, hopefully 4.03 now that it's out ( and in dream land - support for Facebooks Reason could be interesting ).

talios avatar May 23 '16 11:05 talios

I just started the work of updating to 4.03.

Don't hold your breath, however: it will be a major update due to numerous changes in the OCaml compiler code base.

xclerc avatar Jun 29 '16 11:06 xclerc

@xclerc Any news about 4.03? (or 4.04?)

dannywillems avatar Nov 15 '16 16:11 dannywillems

I am currently porting Barista (the library used for Java class file manipulation) to 4.04. In the process, major changes have occurred: support for Java 8 and 9, move from camlp4 to ppx, use of new OCaml (language) features, etc.

Once Barista is finalized, I will switch to OCaml-Java itself; the next version should hopefully be available at the end of 2017T1.

xclerc avatar Nov 15 '16 16:11 xclerc

@xclerc Seems awesome! Thanks for your job. Do you think it's possible to write Android applications with ocaml-java? I never tried for the moment.

dannywillems avatar Nov 15 '16 16:11 dannywillems

I'm afraid it is not possible to write Android apps with OCaml-Java.

The first problem is that, to the best of my knowledge, Android does not fully support Java 1.7 while OCaml-Java relies for example on method handles (that are 1.7-specific).

Even if this problem were solved, either by Android support of 1.7 or through some kind of "backport", there would be another problem: OCaml-Java allows one to implement an interface (through a proxy), but does not allow to extend a class. This restriction would bite you quite soon, as you need to extends Activity even for a very simple Android app (at least it was the case the last time I checked).

[the second problem is likely to be addressed in future OCaml-Java version]

xclerc avatar Nov 15 '16 16:11 xclerc

@xclerc latest Android ( 7 and higher ) actually now support Java 8. See https://developer.android.com/guide/platform/j8-jack.html

talios avatar Nov 16 '16 21:11 talios

That's (possibly) good news!

The "possibly" stems from the fact that, although Android now supports Java 8, it support seems to be different from the one in the JDK. For example, there is no java.lang.invoke package -- see: https://developer.android.com/reference/packages.html

There are possibly equivalent classes, but this means that the support for Android has to be explicit in Ocaml-Java (and that binaries compiled for Android/JDK would be incompatible).

xclerc avatar Nov 17 '16 09:11 xclerc

@xclerc I wait for the new version of ocaml-java before testing and try it.

dannywillems avatar Nov 17 '16 11:11 dannywillems

I'm fairly keen to give this project a go when you have time to update it. I can install some of the tools I need on your patched 4.01, but there is at least one that assumes -safe-string from 4.02 is available.

TheSpyder avatar May 19 '17 04:05 TheSpyder

Just curious @xclerc, are you still using ocamljava in production?

vphantom avatar Feb 12 '18 14:02 vphantom

Hello I would like to know if the project ocamljava is now compatible with ocaml 4.04.0? if not what is the difficulty to go to this version, any advice will be appreciate. Thanks Francois from France

flefevre avatar Feb 15 '18 10:02 flefevre

Or rather 4.06 by this point. ^.^;

OvermindDL1 avatar Feb 15 '18 16:02 OvermindDL1

@vphantom Yes, although there is no active development. The deployed application serves a REST API and is hosted on Heroku.

@flefevre I would have to update the compiler patch. As mentioned before, I started updating Barista (underlying library), and will then move to the compiler. The new Barista version should reduce the size of the compiler patch, hopefully making it easier to update for new OCaml versions.

xclerc avatar Feb 20 '18 07:02 xclerc

Hi ! I'm also taking interest in updating ocamljava to a newer version of OCaml (namely 4.10). I have already "fixed" the issues in Barista (mainly relating to the string / bytes distinction), and I'm now grinding my teeth on the patch. I'm not sure where to begin to be honest. Do you have any advice ? Maybe putting the barista library on GitHub would be useful ? I've not been able to find it in your repos

Vertmo avatar Dec 26 '20 10:12 Vertmo