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
thanks 🙂
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
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
🙂
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
I’ve run into this and there is a ticket for it in Clojure FYI
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
Or https://ask.clojure.org/index.php/2393/add-support-for-marking-gen-class-methods-as-native?show=2612 if you want to vote for it
cool, thanks. would it be interesting with a pr? I'm not sure how you usually deal with these things 🙂
https://clojure.org/dev/dev for process