Fork me on GitHub
#graalvm
<
2021-02-08
>
Huahai22:02:37

I have succeeded in building a native version of Datalevin by writing a native image specific LMDB wrapper, here’s my experience doing so, it might be of interest to some of you https://yyhh.org/blog/2021/02/writing-c-code-in-javaclojure-graalvm-specific-programming/

phronmophobic22:02:22

looks really cool. I'm working on a similar project. How did you generate the code for? https://github.com/juji-io/datalevin/blob/master/native/src/java/datalevin/ni/Lib.java Was it manually generated or did you use a somewhat automated process?

Huahai23:02:26

I did it manually

Huahai23:02:08

I imagine it shouldn’t be hard to write a tool to generate it automatically from a header file. It’s pretty mechanical.

phronmophobic23:02:42

ah ok. that's what I'm doing

borkdude22:02:16

@huahaiy This is very exciting. Thank you for taking the time to write this down and to invest the time to make datalevin work with GraalVM. I will consider making a babashka pod for it so we can use a datalog store from scripts :). @lee: added it to https://github.com/lread/clj-graal-docs/blob/master/doc/external-resources.md#articles

👍 6
thanks2 3
Huahai22:02:08

@borkdude , thanks for started me in going down this rabbit hole. It’s indeed exciting to work with native image in clojure. Thanks for including Datalevin as a babashka pod, please let me know if you need anything from me. I will spend time finishing the native command line shell for Datalevin.

👍 9