Java Native Interface (JNI)

Sunday, September 16th, 2007

Pro JNI

I’ve worked with lots of embedding APIs for C in my life (Perl/XS, PHP, PostgreSQL/libpg, etc) and I really enjoyed one aspect of the Java JNI: the Sun guys made the wise decision of putting everything into just the jni.h header file and not even providing a corresponding libjni.a.

get viagra without a prescription

All JNI API functions are part of a large environment data structure (as function pointers) passed to all Java native functions.

I don’t know whether it was intentional or just by accident.

canadian cialis uk

But this is an ultra portable way for loading extensions as Dynamic Shared Objects (DSO) as there are no symbols of the application the Unix Run-Time Link-Editor (RTLD) has to resolve for the loaded DSO. This is usually a portability issue when dealing with DSOs, although I guess mostly all Unix programmers never recognize. Nice done, Sun! I would like to see more DSO based embedding APIs which use this approach.
[more…]

10 days, 6 languages, …

Sunday, September 16th, 2007

The last two weeks I’ve first coded in my lovely C and the neat Java programming languages for developing the Java JNI-based bindings to my OSSP uuid C library. Then I worked on key management functionality for OSSP ase (a web application) in my preferred web programming languages Perl (backend) and JavaScript (frontend). Finally, the last days I was forced to switch over to programming in C++ (main application) and Lua (run-time hooks and extensions) while hacking on a NETSYNC-based access control functionality for the distributed version control system Monotone.

So, I ended up coding in 6 different programming languages in the short time range of just about 10 man-days. Such speedy switching of the software artist’s tools is not something I like very much, but it at least keeps one trained this way ;-) Now, at the weekend, I’m reflecting this programming expedition and recognize a few experiences which are IMHO worth noting in my BLOG.

thesis creator

Let me share my train of thoughts in the following three BLOG articles about 1. Java Native Interface (JNI), 2. Lua and embedding a scripting language into applications, and 3. distributed version control versus central access control.

Announcement: OSSP js 1.6.20070208

Thursday, February 8th, 2007

I’ve today released OSSP js 1.6.20070208, the OSSP distribution of the Mozilla JavaScript Engine “SpiderMonkey”.

This new release contains the latest upgrade to JavaScript 1.6 from the upstream Mozilla sources as of 2007-02-08, the build environment was upgraded to GNU autoconf 2.61 and a “jspack” utility was added. “jspack” is an adaption of Dean Edwards JavaScript packer, version 2.0.2, for use as a stand-alone Unix tool under the CLI of the OSSP js JavaScript engine.