Re: Calling other code in Java applications and applets
At 21:50 4/29/96, Timothy C. May wrote:
By the way, I had a discussion at a party with several Sun folks and other Java programmers, and they agreed that external code (C, for example) could be called, even by an _applet_, if arranged. For example, various underlying graphics routines in the AWT (Alternative Window Toolkit) package are of course using underlying code written in various other languages, code that has been reasonably optimized for speed.
I understand that calling C libs from Java is possible, but the details how to go about that are still hazy to me. It is also unclear if Sun will support this dual coding as a general capability that can be used by all Java apps (don't think of Java just as downloadable applets) or require that all modules, to give an example, for a certain soon to be very relevant Java application to be written in 100% Java. [...]
The interesting thing here is that a crypto package, perhaps with speed-optimized underlying routines in C or even hand-coded machine language, could be released. It might be that patent holders (not that I am endorsing this) could license such packages to users.
Thus,
import java.bignum.* import.java.entropy.* import java.rsa.* import java.digicash.* ...
(Such packages may need approval by Sun, etc., and formal integration, a la AWT. But certainly there is talk of replacing AWT with something else, so changes and additions are clearly possible.)
Presumably, such packages would have to be signed by Sun. Needless to say, these certificates would cost money. A potentially lucrative source of revenue for Sun. Nothing wrong with that. Disclaimer: My opinions are my own, not those of my employer. -- Lucky Green <mailto:shamrock@netcom.com> PGP encrypted mail preferred.
Lucky Green wrote:
At 21:50 4/29/96, Timothy C. May wrote:
By the way, I had a discussion at a party with several Sun folks and other Java programmers, and they agreed that external code (C, for example) could be called, even by an _applet_, if arranged. For example, various underlying graphics routines in the AWT (Alternative Window Toolkit) package are of course using underlying code written in various other languages, code that has been reasonably optimized for speed.
I understand that calling C libs from Java is possible, but the details how to go about that are still hazy to me. It is also unclear if Sun will support this dual coding as a general capability that can be used by all Java apps (don't think of Java just as downloadable applets) or require that all modules, to give an example, for a certain soon to be very relevant Java application to be written in 100% Java.
Our Navigator 3.0 release will allow java and javascript to call into plugins. Since plugins are native code, you will be able to freely mix C and Java. Of course you will have to get the user to install your plugin on their disk. --Jeff -- Jeff Weinstein - Electronic Munitions Specialist Netscape Communication Corporation jsw@netscape.com - http://home.netscape.com/people/jsw Any opinions expressed above are mine.
Ian Goldberg wrote:
-----BEGIN PGP SIGNED MESSAGE-----
In article <3187209C.3E5B@netscape.com>, Jeff Weinstein <jsw@netscape.com> wrote:
It might be interesting to make a small plugin that just does some core stuff like gathering entropy, mod-exp, and related stuff difficult or too slow in java. I mainly brought it up because people were asking about calling native code from java.
In an alternate universe in which I didn't have projects to finish, I may be interested in doing something like this. However, I haven't been able to find information on how to write Unix (or preferably portable) plugins.
Any hints?
You can get the unix plugin SDK from ftp://ftp20.netscape.com/sdk/unix/ --Jeff -- Jeff Weinstein - Electronic Munitions Specialist Netscape Communication Corporation jsw@netscape.com - http://home.netscape.com/people/jsw Any opinions expressed above are mine.
Ian Goldberg wrote:
-----BEGIN PGP SIGNED MESSAGE-----
In article <31887DD0.300F@netscape.com>, Jeff Weinstein <jsw@netscape.com> wrote:
Ian Goldberg wrote:
-----BEGIN PGP SIGNED MESSAGE-----
In article <3187209C.3E5B@netscape.com>, Jeff Weinstein <jsw@netscape.com> wrote:
It might be interesting to make a small plugin that just does some core stuff like gathering entropy, mod-exp, and related stuff difficult or too slow in java. I mainly brought it up because people were asking about calling native code from java.
In an alternate universe in which I didn't have projects to finish, I may be interested in doing something like this. However, I haven't been able to find information on how to write Unix (or preferably portable) plugins.
Any hints?
You can get the unix plugin SDK from ftp://ftp20.netscape.com/sdk/unix/
I downloaded this, and I notice you don't have a "makefile.linux". Is that just because no one's bothered to make one, or does Linux Atlas actually not support plugins at all? (Quickly checking the binary...) I see that Linux Atlas is still a.out. Ick. That would make supporting plugins pretty tough. If it were in ELF, things would be _way_ easier; in fact, I'd probably say trivial (but that's just me).
I'd venture a guess that most people who have a Linux box sufficiently cool to run netscape at all, have the ability to run ELF. In fact, there are probably a lot of people (like everyone who bought Slackware 3.0 or a recent RedHat) for which netscape is the _only_ a.out binary on their system.
The reason I'm pointing this out is (obviously) because Linux is my main development platform, and I'd like to be able to try writing plugins for things like crypto and ecash.
- Ian "Add me to the 'Make an ELF Linux binary!!!' list..."
Ask and ye shall receive. 3.0b4 for Linux is in elf format. Sorry, but I don't know what the deal is with plugins on linux. --Jeff -- Jeff Weinstein - Electronic Munitions Specialist Netscape Communication Corporation jsw@netscape.com - http://home.netscape.com/people/jsw Any opinions expressed above are mine.
Our Navigator 3.0 release will allow java and javascript to call into plugins. Since plugins are native code, you will be able to freely mix C and Java. Of course you will have to get the user to install your plugin on their disk.
That's the problem, installing the plugin. I (and some others, I think) was hoping that it would be possible to build powerful crypto applets and put them up on web pages. That way everyone with a java enabled copy of Netscape could use a remailer or send crypted mail without having to download, install, and configure software. If people have to download and install a plugin to use a java mixmaster applet, why not just download and install a native mixmaster client? Of course there are other reasons to use java -- platform independence, for example. But it's the user's ability to download and run applets just by jumping to a web page that has everyone excited. With that gone (for crypto), java loses a lot of its lustre (again, for crypto work).
-----BEGIN PGP SIGNED MESSAGE----- In article <3187209C.3E5B@netscape.com>, Jeff Weinstein <jsw@netscape.com> wrote:
It might be interesting to make a small plugin that just does some core stuff like gathering entropy, mod-exp, and related stuff difficult or too slow in java. I mainly brought it up because people were asking about calling native code from java.
In an alternate universe in which I didn't have projects to finish, I may be interested in doing something like this. However, I haven't been able to find information on how to write Unix (or preferably portable) plugins. Any hints? - Ian -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMYevHUZRiTErSPb1AQFBygP+Nvsv39AgH9w4Trnf4Io3TnVDBRAt3QxL 2WnuepiDRyMJLxmeyULEIad51ct6CPkDwhs2e/8dTNiEMrDKq3GcbpEOeeM/uHGR NEF8FgVf5IZMnp7Q2pMTWaRbPr7W0sV2S/gnZP1TU15Xlil0wdOQzpUKpOjokAIN RWKxEoeIpE4= =Tpjj -----END PGP SIGNATURE-----
Jeff Weinstein <jsw@netscape.com> wrote:
It might be interesting to make a small plugin that just does some core stuff like gathering entropy, mod-exp, and related stuff difficult or too slow in java. I mainly brought it up because people were asking about calling native code from java.
In an alternate universe in which I didn't have projects to finish, I may be interested in doing something like this. However, I haven't been able to find information on how to write Unix (or preferably portable) plugins.
Any hints?
- Ian
I don't have any hints, but I think people need to be aware up front that calling native code from a Java applet disables any security that might otherwise be enforced for the applet. It's OK to do this, as long as you understand up front how things work. One of the restrictions on applets is that they can't load DLLs or .so's. People get around that restriction by choosing to install a DLL on the local machine in such a way that the applet can invoke methods defined in that DLL (or .so) By choosing to do that, they're deliberately saying "it's OK, I understand this native method might do anything at all on the machine and it's OK by me" Marianne
Alex Strasheim wrote:
Our Navigator 3.0 release will allow java and javascript to call into plugins. Since plugins are native code, you will be able to freely mix C and Java. Of course you will have to get the user to install your plugin on their disk.
That's the problem, installing the plugin.
I (and some others, I think) was hoping that it would be possible to build powerful crypto applets and put them up on web pages. That way everyone with a java enabled copy of Netscape could use a remailer or send crypted mail without having to download, install, and configure software.
If people have to download and install a plugin to use a java mixmaster applet, why not just download and install a native mixmaster client?
Of course there are other reasons to use java -- platform independence, for example. But it's the user's ability to download and run applets just by jumping to a web page that has everyone excited. With that gone (for crypto), java loses a lot of its lustre (again, for crypto work).
It might be interesting to make a small plugin that just does some core stuff like gathering entropy, mod-exp, and related stuff difficult or too slow in java. I mainly brought it up because people were asking about calling native code from java. --Jeff -- Jeff Weinstein - Electronic Munitions Specialist Netscape Communication Corporation jsw@netscape.com - http://home.netscape.com/people/jsw Any opinions expressed above are mine.
-----BEGIN PGP SIGNED MESSAGE----- In article <31887DD0.300F@netscape.com>, Jeff Weinstein <jsw@netscape.com> wrote:
Ian Goldberg wrote:
-----BEGIN PGP SIGNED MESSAGE-----
In article <3187209C.3E5B@netscape.com>, Jeff Weinstein <jsw@netscape.com> wrote:
It might be interesting to make a small plugin that just does some core stuff like gathering entropy, mod-exp, and related stuff difficult or too slow in java. I mainly brought it up because people were asking about calling native code from java.
In an alternate universe in which I didn't have projects to finish, I may be interested in doing something like this. However, I haven't been able to find information on how to write Unix (or preferably portable) plugins.
Any hints?
You can get the unix plugin SDK from ftp://ftp20.netscape.com/sdk/unix/
I downloaded this, and I notice you don't have a "makefile.linux". Is that just because no one's bothered to make one, or does Linux Atlas actually not support plugins at all? (Quickly checking the binary...) I see that Linux Atlas is still a.out. Ick. That would make supporting plugins pretty tough. If it were in ELF, things would be _way_ easier; in fact, I'd probably say trivial (but that's just me). I'd venture a guess that most people who have a Linux box sufficiently cool to run netscape at all, have the ability to run ELF. In fact, there are probably a lot of people (like everyone who bought Slackware 3.0 or a recent RedHat) for which netscape is the _only_ a.out binary on their system. The reason I'm pointing this out is (obviously) because Linux is my main development platform, and I'd like to be able to try writing plugins for things like crypto and ecash. - Ian "Add me to the 'Make an ELF Linux binary!!!' list..." -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBMYj0bEZRiTErSPb1AQGWrAP/Qny7XJzKfqTj2QOQc8+QLs+utu0xA45O +MTxJEHPmdijIxei3TGiJTJP46eYR0RJ8O+uoAB0pTE5UKnUyiwpS3eG6FUpw2FB mQtbhGMeX1oG3v/XHG0LAPPcEf0gW/MxcSMHHKuDlSxfpn4tkSPj79XHKjYOmS4M 6nZMxi4m3us= =U2/t -----END PGP SIGNATURE-----
participants (5)
-
Alex Strasheim -
iang@cs.berkeley.edu -
Jeff Weinstein -
mrm@netcom.com -
shamrock@netcom.com