Search code examples
java-native-interfaced

Using D to program to the Java Native Interface


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?


Solution

  • 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.