public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Kreimeier <bk@lokigames.com>
To: Per Bothner <per@bothner.com>
Cc: java-discuss@sourceware.cygnus.com, classpath@gnu.org
Subject: Re: Proposal for CNI/JNI problems
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <14465.3924.684222.646003@ares.lokigames-lan.com> (raw)
In-Reply-To: <m2snzzhqxs.fsf@magnus.bothner.com>

Per Bothner writes:
 > Gcj will (soon) digest JNI source as is. 

Very good.

 > We handle "compilation of Java+JNI source to native code"
 > using any C compiler combined JNI run-time support.
 > You will be free to use JNI.  It's your choice: JNI gives you
 > portability, but it is much slower and much more tedious to 
 > use than CNI.

OK, let's push this a bit further. CNI is elegant and efficient
because it knows which VM it will be executed with, and can thus
take shortcuts. I guess that the discussion about a CNI+JNI
abstraction, or preproecessor mappings of one to the other
indicate that it is difficult if not impossible to exploit at
compile time additional information about object memory layout,
for a JNI source?

In other words, the semantics of JNI code prohibits all
CNI-like optimizations due to parsing complexity issues?


 > The current discussion is about a *third* option: Write your
 > application in CNI (mostly, perhaps with some conditional
 > compilation), and then use a special compiler (G++) that translates
 > your CNI source into a JNI binary.  That binary will work with *any*
 > JVM that support JNI.  That gives you the convenience of writing CNI,
 > and the speed of CNI when running on a CNI-supported platform.  You
 > also get (most of) the advantage of JNI portability, since you can use
 > any JVM that supports JNI, but you are restricted to compiling your
 > native code using G++.

If a hypothetical G++ "emit-jni" option would generate JNI C 
(not C++ or heavily macro'ed) code, this restriction would
only hurt on machines that have no G++ (which could be overcome
by cross-compiling to C or native).


 > The goal is to give people (and library writers) options.

No doubt, JNI ABI compatibility would make CNI a much more
viable option. In this case, the major concerns seem to be
Hans Boehm's points (3) and (5), quote:

  (3) automatically JNIizing [CNI] code completely
       is essentially impossible

[Question is, how much ground can be covered? Good enough 
 for 90% of the usual applications using native methods?]

  (5) anything requiring significant gcc changes will
       delay the project appreciably

[Good point. How long will it take to add ability to link 
 against JNI-ABI compliant DLL's, by comparison?]

                                        b.

  reply	other threads:[~2000-04-01  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-01  0:00 Paul Fisher
2000-04-01  0:00 ` Per Bothner
2000-04-01  0:00   ` Paul Fisher
2000-04-01  0:00     ` Aaron M. Renn
2000-04-01  0:00       ` Stuart Ballard
2000-04-01  0:00         ` Chris Blizzard
2000-04-01  0:00           ` Chris Blizzard
2000-04-01  0:00     ` Per Bothner
2000-04-01  0:00   ` Jochen Hoenicke
2000-04-01  0:00     ` Stuart Ballard
2000-04-01  0:00     ` Jon Olson
2000-04-01  0:00     ` Per Bothner
2000-04-01  0:00   ` Bernd Kreimeier
2000-04-01  0:00     ` Per Bothner
2000-04-01  0:00       ` Bernd Kreimeier [this message]
2000-04-01  0:00         ` Per Bothner
2000-04-01  0:00           ` Bernd Kreimeier
2000-04-01  0:00             ` Per Bothner
2000-04-01  0:00               ` Bernd Kreimeier
2000-04-01  0:00                 ` Per Bothner
2000-04-01  0:00                   ` Alexandre Oliva
2000-04-01  0:00                   ` Bernd Kreimeier
2000-04-01  0:00 Lam.Mark
2000-04-01  0:00 ` Aaron M. Renn
2000-04-01  0:00   ` Brian Jones
2000-04-01  0:00 David Pettersson
2000-04-01  0:00 ` Per Bothner
2000-04-01  0:00 Boehm, Hans

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=14465.3924.684222.646003@ares.lokigames-lan.com \
    --to=bk@lokigames.com \
    --cc=classpath@gnu.org \
    --cc=java-discuss@sourceware.cygnus.com \
    --cc=per@bothner.com \
    /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).