Fork me on GitHub
#graalvm
<
2020-06-14
>
Saikyun14:06:17

is it possible to declare functions as native when using gen-class? I found ACC_NATIVE here: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/asm/Opcodes.java but it doesn't seem to be used anywhere in clojure

Alex Miller (Clojure team)18:06:09

I’ve run into this and there is a ticket for it in Clojure FYI

Saikyun18:06:57

ah, cool. I couldn't find any tickets regarding this. it was a bit hard to search for "native" though, haha. 🙂 thanks for the info

Saikyun19:06:41

cool, thanks. would it be interesting with a pr? I'm not sure how you usually deal with these things 🙂

Saikyun07:06:44

thanks 🙂

Saikyun14:06:50

right now I've solved it by leaning on java-classes with native-declarations, but it'd be very useful if I didn't have to do that

Saikyun16:06:34

in case anyone else needs it, I added support for it: https://github.com/Saikyun/clojure you can use ^:native in the same way as you use ^:static 🙂

Saikyun18:06:53

you can also just "add" a new gen-class , here's a repo where I utilize this "technique". tested with clojure-1.10.2-alpha1. https://github.com/Saikyun/native-image-clojure-c