OCaml bindings for Coherence (without SWIG)

I am much happier with my second attempt at an OCaml binding for Oracle Coherence. This way is easier to build, easier to use, and I could reuse all of the C++ code from my first attempt. See the code on GitHub.

Click to enlarge


My general strategy for this is going to be:

  1. Use a class (or classes) written in pure C++ to interact with Coherence
  2. Use extern "C" functions first to instantiate an object from (1) and return an object pointer to OCaml, then to invoke methods via that pointer.
  3. From OCaml, call the function to create the object, then pass the pointer from (2) into the other C functions using the normal OCaml/C interface
  4. Pre- and post- grid operations implemented in OCaml

The next challenge will be to use MapListener/Continuous Query to execute code in OCaml in response to events within the grid – if possible, configuring it from the OCaml side. And then to do it with more complex data structures than simple strings.

About Gaius

Jus' a good ol' boy, never meanin' no harm
This entry was posted in C++, Coherence, COHML, Ocaml, Operation Foothold. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s