tags:

views:

118

answers:

2

I've been looking at the D programming language and it looks like a lot of fun to try for someone already proficient in C++.

Can I use D to program to the Java Native Interface which is a C interface?

+4  A: 

I don't know much about the JNI, but for functions declared extern(C), and using only C datatypes, D matches the C ABI, so the JNI should not even know the difference. You probably just need to translate a few headers to D, which can be partially automated with the htod utility.

dsimcha
A: 

I'm pretty sure it's possible (I have used D and C++/JNI).

You'd have to convert the JNI headers to D, and as JNI is ABI agnostic these headers don't even change much with new JDK releases.

The annoying part is that the javah utility does not generate D header files .di

ponce