public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@redhat.com>
To: frysk@sourceware.org
Subject: cni vs jni
Date: Wed, 11 Jul 2007 15:03:00 -0000	[thread overview]
Message-ID: <4694F12E.6080406@redhat.com> (raw)

[This was today's technical topic]

What are the advantages vs disadvantages of CNI over JNI.  Going 
forward, should Frysk stick with the GCJ specific CNI, or migrate to the 
more standard and accepted JNI.  Discuss.

- cagney noted that while CNI isn't going away, it certainly isn't being 
pushed [he keeps getting hints that frysk should break its dependency]

- MJW noted that the JNI is far more cumbersome for accessing class 
data, complex data types, and callback methods.  Reflection calls are 
needed to access those methods.  On the other hand full access to 
reflection becomes possible.

- MJW indicated that JNI works best when information is exchanged using 
simple types (e.g., ints) and simple interfaces.  Consequently it is 
best to perform large chunks of work in JNI with few and thin calls 
to/from Java.

- Tim noted [is this right] that CNI gives us a fast simple and 
efficient access to the Java interfaces from C++.  A switch to JNI would 
loose that; and a loss of one of the advantages of being able to code 
most stuff in Java.

- Swig was mentioned; Phil noted that he'd looked at that for the 
elfutils bindings but discarded it as it over exported the interfaces - 
for frysk only a focused subset of the interfaces need to be bound; 
Cagney also noted that Swig didn't understand the memory patterns and 
requirements of libraries such as elfutils.

- Phil asked if it was possible to combine CNI and JNI code; cagney 
indicated that it was (well sort of) as it is clumsy.

- cagney noted that pushing more functionality into the native layer 
could make it easier to add other, additional bindings (binding C++ is 
easier than back binding native java).

Possible options

- simplistically translate the bindings into JNI

- push more core code into C++ and move the bindings to a higher layer

- status quo

Schedule?

             reply	other threads:[~2007-07-11 15:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11 15:03 Andrew Cagney [this message]
2007-07-11 17:12 ` Andrew Haley
2007-07-12 13:57   ` Andrew Cagney
2007-07-12 14:00     ` Andrew Haley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4694F12E.6080406@redhat.com \
    --to=cagney@redhat.com \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).