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/.
chrisn 2021-03-18T22:04:14.003500Z

Is there a known way to convert a long integer into a graal C VoidPointer type?

chrisn 2021-03-18T22:04:37.004Z

My hacking about produced a compiler error and someone has had to do this by now.

borkdude 2021-03-18T22:23:51.004400Z

@chris441 You might have some luck asking in the GraalVM slack community

borkdude 2021-03-18T22:24:08.004600Z

https://app.slack.com/client/TN37RDLPK

Huahai 2021-03-18T22:27:39.005100Z

◦ org.graalvm.word.WordFactory

Huahai 2021-03-18T22:27:53.005500Z

static <T extends PointerBase> T pointer(long val) Unsafe conversion from a Java long value to a pointer.

chrisn 2021-03-18T22:27:55.005700Z

That won't work at least at the repl.

chrisn 2021-03-18T22:28:15.006200Z

It relies on the compiler being loaded...perhaps it will work during compilation though. =

Huahai 2021-03-18T22:28:32.006700Z

most things in that C api probably won’t work at repl

Huahai 2021-03-18T22:28:45.007Z

they are mostly word, not object, so not good with clojure

Huahai 2021-03-18T22:28:55.007300Z

you will have to wrap them

chrisn 2021-03-18T23:16:21.007600Z

Thanks, that is really helpful. Testing it out.