graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
dominicm 2021-06-05T20:42:47.032Z

I happen to know there's reflection in bidi, so example of doing this:

~ 1m 18s
❯ clj -Sdeps '{:deps {bidi/bidi {:mvn/version "2.1.6"}}}' -M -e '(set! *warn-on-reflection* true)' -r
true
user=> (require 'bidi.bidi)
Reflection warning, bidi/bidi.cljc:20:31 - call to static method decode on java.net.URLDecoder can't be resolved (argument types: java.lang.String, unknown).
nil
user=> 

borkdude 2021-06-05T20:53:04.032700Z

ok, I think:

$ clj -M -e "(set! *warn-on-reflection* true)" -e '(fn [x] (.length x))'
true
Reflection warning, NO_SOURCE_PATH:1:9 - reference to field length can't be resolved.
#object[user$eval138$fn__139 0x73eb8672 "user$eval138$fn__139@73eb8672"]
will do fine then. As long as you do the set! before any other namespaces are loaded

borkdude 2021-06-05T20:54:29.032900Z

confirmed:

$ clj -M -e "(set! *warn-on-reflection* true)" -e "(require 'asami.core)"
true
Reflection warning, asami/graph.cljc:43:58 - reference to field id on java.lang.Object can't be resolved.
Reflection warning, asami/graph.cljc:68:21 - reference to field id can't be resolved.
Reflection warning, zuko/logging.clj:14:36 - reference to field getClassName can't be resolved.
Reflection warning, zuko/logging.clj:13:30 - reference to field getStackTrace can't be resolved.
Reflection warning, zuko/logging.clj:78:5 - call to method append on java.io.Writer can't be resolved (argument types: unknown).
planner.cljc:107 recur arg for primitive local: mcount is not matching primitive, had: Object, needed: long
Auto-boxing loop arg: mcount
Reflection warning, asami/durable/block/file/voodoo.clj:18:14 - reference to field clean on java.lang.Object can't be resolved.

borkdude 2021-06-05T21:07:20.033100Z

$ ./asami
(["Explorers"] ["Demolition Man"] ["Johnny Mnemonic"] ["Toy Story"])

3
borkdude 2021-06-05T21:12:49.033200Z

yes, works fine