The Artima Developer Community
Sponsored Link

Java Buzz Forum
JNI, Systen.unloadLibrary(), @Native(dll=foo, function=bar), ...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
JNI, Systen.unloadLibrary(), @Native(dll=foo, function=bar), ... Posted: Oct 31, 2006 5:29 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: JNI, Systen.unloadLibrary(), @Native(dll=foo, function=bar), ...
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

Dear Java people,

I understand that everybody is busy right now with new and exciting Java language features like closures and continuations and module systems and that Sun people are also busy with Open Sourcing pieces of (but not the whole) Java SE and ME before year's end and I'm really happy about all these developments.

But before you go off to the deep end and spend years debating, reviewing, testing, and releasing all these wonderful features, which I'm sure will draw more developers to the Java platform, could somebody please take a few minutes and take a look at my modest Java feature requests:

It has to do with JNI, the most elaborate and comprehensive native code interface I've ever seen in popular programming languages. It gets the job done (if you have the resources) but it's a pain to program with. And it is sometimes considered a performance bottleneck, what with all the locking and copying when a variable crosses the JNI boundary.

The first thing that I would like to have is a System.unloadLibrary() call to balance out the System.loadLibrary() call that has been present in the Java language from the beginning. This would make writing unloadable plug-ins that uses native code easier.

The second thing I would like to have is a @Native annotation that would direct the runtime system to generate JNI wrappers automatically. Come to think about it, had annotations been available in the Java language from the beginning, there probably wouldn't be a native keyword at all. The more I think about it, the more I think something like the following would make sense:

@Native(dll=foo,function=bar)
public void bar();

The C/C++ stuff that people write after doing javah are boring, repetitive, tricky, and hard to get right. If the Java runtime can automatically generate the stuff from the annotation, that would bring about a productivity boost to the entire Java scene. Not only don't Java people have to write tedious code just to use native library functionality, they also don't have reinvent the wheel in Java because using a wheel written in C/C++ is so hard.

Talking about using natively available features, what's up with the HTML widget in the JDK. The last time I checked, it's HTML 3.2 and could not render even Yahoo.com right. Can we remove it from the JDK and bring in a native widget that uses the latest natively available HTML widget on the platform?

Read: JNI, Systen.unloadLibrary(), @Native(dll=foo, function=bar), ...

Topic: AnthillPro 3.0 Previous Topic   Next Topic Topic: When Google Search Fails

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use