This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-14
Channels
- # aws (6)
- # babashka (31)
- # beginners (69)
- # biff (9)
- # boot (9)
- # bristol-clojurians (1)
- # calva (20)
- # chlorine-clover (2)
- # cider (8)
- # cljsrn (24)
- # clojure (25)
- # clojure-norway (4)
- # clojure-spec (29)
- # clojure-uk (7)
- # conjure (23)
- # datahike (5)
- # datomic (39)
- # emacs (4)
- # fulcro (4)
- # graalvm (11)
- # honeysql (1)
- # lambdaisland (1)
- # leiningen (8)
- # liberator (1)
- # libpython-clj (3)
- # malli (6)
- # mxnet (1)
- # off-topic (94)
- # pedestal (13)
- # re-frame (4)
- # releases (2)
- # shadow-cljs (8)
- # spacemacs (22)
- # sql (9)
- # vim (1)
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
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 🙂
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