Fork me on GitHub

I tried to make a socket REPL work with GraalVM last night and I bumped into the locking issue again. It does work without a problem on 1.9.0. I wonder what changed between 1.9.0 and 1.10.1 that makes this error appear, while the Android locking issue on JIRA is much older than that?


On x86 or aarch64? With adoptopenjdk-11-hotspot compiled graalvm? I check it too.


binary, both Mac and Linux


Ok in this case x86.


I check it


(Socket REPL with your own :eval fn that is)


Could very well be. If I remove the locking reference in server.clj I still get the same error

David Pham13:08:33

What are the chances of getting Clojure to work on GraalVM?


@neo2551 most of it already works. Is there some code that you couldnt get to work?

David Pham15:08:08

Can you do repl development on GraalVM?


If you're asking whether you can use the Clojure REPL with GraalVM the answer is: Yes! Absolutely.


It's a full-featured Java runtime. It behaves more or less like any other, at least in my experience. Works with CIDER, nREPL, etc.

David Pham15:08:40

Ok! I thought the limitations of GraalVM would not allow Clojure to load namespaces dynamically


Only when you're building self-contained binaries.

David Pham15:08:08

Workflow using GraalVM and some experience sharing Would be a great subject for a talk


Until you start trying to build self-contained binaries it's literally no different from using Oracle or OpenJDK, at least as far as I know.

David Pham15:08:58

So, the only difference is when you create uberjar?

David Pham15:08:29

So you could use GraalVM Instead of JVM and it would work?

David Pham15:08:45

With better speed?

David Pham15:08:52

And better memory?


The differences arise when you need to create a native image.

David Pham15:08:17

But do you need to?


No. You ought to be able to use it as a stand-in replacement for Oracle Java (or OpenJDK). In fact, some people are arguing that people ought to do that.


There's a lot of hype around the native image stuff, but I'm personally just as excited about the polyglot features.

David Pham16:08:03

We could just use scikit learn out of the box

David Pham16:08:16

And I can finally ditch R xD


Or, like, all of R.

David Pham16:08:40

I am thinking of exploring Apache Arrow

David Pham16:08:45

For cljs or clj


Oracle's claims about the performance of hitherto non-JVM languages are bananas.


Like, look at FastR.

David Pham16:08:30

I need a DF (timeseries) data structure and it is pain without it

David Pham16:08:40

Guess I will try to sneak GraalVM into work :)


> sneak Should be pretty painless. You could recommend trying it out to see if there are performance gains. 😉


I've been noodling on a library to make GraalVM cross-language interop easier from the Clojure side.


So far the experience has been completely magical.

David Pham16:08:52

Haha, I am solo CLJS developer in a data science team, guess it would be easy for me to make the technical point lol

David Pham16:08:17

Okay okay, you got me hooked I will try it. I hope the experience is painless, is there any intro on how to swap the JVM with GraalVM?


It's just a matter of setting your JAVA_HOME, just like with any other Java.


I personally use jEnv because I find that it plays well with my toolchain (Emacs, CIDER).


(put-binding! "incall" (proxy-fn #(map inc %)))
(r-eval "incall(1:10) + 1")
[3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0]

🤯 12
David Pham16:08:17

Looks cool :)

David Pham16:08:36

Which libraries are you interested in for R?


I'm new to R actually, so I don't have a specific library in mind.


At work I've been exploring making a Clojure library we develop available to R programmers.


@neo2551 Not to throw a wet blanket on your enthusiasm, but I should say that GraalVM does not make dependency hell any easier. All the pain of working with scikit learn, scipy, and friends will be just as bad in Graal-land.


I haven't yet been able to get Stan to work with GraalVM yet, for example.

David Pham16:08:15

Why is there dependency hell?


Oh, I've just found that getting the right versions of libraries to play well together can be a pain when native code is involved.

David Pham16:08:21

I always wanted to avoid learning Java, but at some point I will have to I guess.

David Pham16:08:52

Python support is experimental haha

David Pham16:08:59

Guess R will be the library then.

David Pham16:08:43

We could have a CLJ with CLJS interop XD


Oh yeah.


Not unlike Nashorn. RIP.

David Pham16:08:37

So what is stopping the community to move to graalVm?


You'd have to ask the community. 🙂


Huh. I'm seeing claims that Oracle JDK 11+ might support some GraalVM features? 😮


@neo2551 You may want to join #data-science if you're not already in there.

David Pham16:08:08

Yeah I joined :) I just need time to play a bit with some of their tools.

David Pham16:08:08

I feel I am perpetuating the Lisp curse with clojure, I feel I want try things on my own more than to reuse what the community already created.


Which tools are you thinking of?


I can relate.

Daniel Slutsky19:08:49

@zane @neo2551 , regarding R on GraalVM, I have had some basic experiments recently, thanks to a discussion with @slack.jcpsantiago . See some examples here -- maybe this helps:


@U066L8B18 I don't suppose you've had any luck getting FastR to work with Stan?

Daniel Slutsky21:08:14

No. 😞 Trying to install it, I get some errors.




I'm trying to work through them.

David Pham19:08:59

Seems really interesting!

parrot 4