graalvm

2024-05-28T23:51:25.754029Z

What's happened in the last 2 years around native image? Is it still finicky with not all Java constructs supported? Is there still no cross compilation? Is the paid Graalvm still there and locks certain optimizations behind it?

emilaasa 2024-05-29T07:39:22.033139Z

All reflection issues I've ran into are possible to mitigate, albeit somewhat annoying at times.

littleli 2024-05-29T09:43:52.714389Z

Bytecode modification on the fly cannot be supported, so modification of code via reflection, creating new classes etc cannot be done under native-image. It's called closed world assumption. I believe Oracle variant has support for profile guided optimization, which usually delivers slightly better results in production workflows. But for most utilities that we write here this is not that much of a value in my opinion.

borkdude 2024-05-29T13:51:42.522439Z

reflection can be done btw, using the correct config

borkdude 2024-05-29T13:52:02.468299Z

all babashka interop is in fact implemented using reflection

littleli 2024-05-29T13:52:38.363119Z

I guess it's read-only kind of reflection right? So no dynamic proxies etc.

borkdude 2024-05-29T13:55:51.091109Z

yes

littleli 2024-05-29T13:56:20.981269Z

ok it can even do dynamic proxies, but it has to have all usages covered... that's pretty impressive

littleli 2024-05-29T13:56:37.935839Z

mindblowing

➕ 1
littleli 2024-05-29T13:57:52.232899Z

I believe it basically boils down to having all under "closed world assumption"

grounded_sage 2024-06-05T13:01:29.233529Z

When you say native image can be as fast. Does that even count cpu bound tasks that benefit a lot from JIT?

grounded_sage 2024-06-05T13:02:21.813419Z

Also is there any good resources on inclusion of Python/JS libs in a Clojure project? When I looked in the past it had a lot of friction so I avoided it.

lread 2024-05-29T04:38:16.512959Z

Hiya @didibus! GraalVM native image is getting smoother and faster with each release. Apparently, a native image can now be as fast as running on the JVM. There is still no cross-compilation. There are 2 versions of GraalVM: Oracle and Community. The Oracle variant (the one with optimizations) is now also free to use but has a different license than the Community variant. If you are more specific with your finicky Java constructs question, maybe someone can chime in with an answer.

2024-05-29T04:42:31.944929Z

I just remembered that things that were too dynamic, reflection, etc. was challenging.

2024-05-29T04:43:03.666129Z

And so like, I think borkdude had to rewrite certain libs to make them work with native-image