spotify / annoy-java

Approximate nearest neighbors in Java
Apache License 2.0
138 stars 46 forks source link

Using JNA instead of re-writing code #12

Closed nemo83 closed 7 years ago

nemo83 commented 7 years ago

Hi,

is there any reason why you guys are rewriting the code in java instead of using JNA as it has been done for annoy4s?

a1k0n commented 7 years ago

Pretty sure using JNI is the plan. https://github.com/yonromai/annoy-java/tree/v0.4.2 ping @yonromai

The reason? When this was originally written, annoy was a python library and wasn't factored into a reusable C++ library, and, I don't know, I kind of wanted to prove it could be done in pure Java because @erikbern said it couldn't. :)

yonromai commented 7 years ago

The java implementation has worked fine for a while, although it's getting annoying to keep java's codebase aligned with the C++ one. (poor pun intended..) The plan is indeed to move to a native binding solution, although there might be some problems with JNI's GPL license.