Just got a notification for 21.0.0 release: https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-21.0.0
improved method handles support for native-image :hyper-clap:
I am watching their live stream (link above)
Wow, Java on Truffle: https://www.graalvm.org/reference-manual/java-on-truffle/
cue in the "yo dog" Xzibit joke
What this means: they implemented a Truffle interpreter for Java.
This means you can now compile and run Java from source from within a native-image
(not performantly yet, but they focused on compatibility first)
Truffle can run bytecode too, I’ve never tried truffle. Does it have fast start up time?
> Truffle can run bytecode too This is the new part, announced today.
Truffle is a framework for creating interpreters that are self-optimizing. Languages implemented in Truffle can interop with each other.
So you can have Ruby <-> Python interop if you use both Truffle implementations
and a Truffle interpreter can be used inside a native-image
So theoretically we can have the official JVM Clojure compiler, interpreted by Truffle Java, which runs inside a native-image.
as of now.
Very interesting!
https://medium.com/graalvm/java-on-truffle-going-fully-metacircular-215531e3f840
@borkdude great stuff, did you play with it already?
sorry, I'm quite lazy, not yet ;)
I wonder if we can run the Clojure compiler from bytecode using Truffle Java in a native-image .. and what consequences this would have
yeah, same
does that make Clojure a truffle language now that Java is one?
There is a thesis about a Clojure Truffle implementation from 2015 btw, but I don't think the source is public
it’s also pretty dated, I hear truffle came a long way since then
I think having a proper Clojure on Truffle implementation would be faster than running the Clojure compiler through Java on Truffle, but I guess people should start experimenting with this
I want to play with this, but only after I’ve completed SICP, currently halfway in chapter 3
@eggsyntax did you ever get in touch with Thomas? I saw your tweet https://twitter.com/eggsyntax/status/992523127988121600
Someone told me that sci is a meta-circular interpreter like written in SICP. I have SICP but I never really read it. Then I started in chapter 5 and omg, yes, this is more or less what it is ;)
Unfortunately it looks like the link to the actual masters' thesis now goes to a one-page summary. I may still have a copy around if anyone wants to read it.
The full PDF is here: https://epub.jku.at/obvulihs/download/pdf/501665?originalFilename=true
chapter 4 you mean right? https://sarabander.github.io/sicp/html/Chapter-4.xhtml#Chapter-4
two more sections in chapter 3 until I’m finally there…
correct
I don't believe much there would be significant benefit to rewrite Clojure as Truffle language. Maybe like 20-25% max at peak. Clojure compiler produces already quite effective code. I don't have numbers, but as a former Oracle Labs employee I had some very interesting discussion with Graal/Truffle people in the kitchen :-)
Of course Clojure compiled to Java bytecode can already benefit from improved escape analysis and other goodies offered by GraalVM bytecode interpreter.
@ales.najmann The fun thing about Truffle languages is that they can also be compiled along in a native-image.
or I should say, one fun thing
Yes and they are more natural fit of course
another fun thing is polyglot: one could reach Clojure programs from other languages like Python (not that I'm personally interested in this)
@borkdude but isn’t that also true for Clojure in Java now?
compiling along I mean
well, I mean, eval
would then "just work" and that doesn't right now
it will be interesting if any of these avenues opens up an opportunity for clojure to run well on mobile. I now cljs can be used for mobile apps, but I think a compiled or sufficiently efficient intrepreter would be really cool.
In that area, this could also be interesting: https://twitter.com/cgrand/status/1350063059864346624
I have never tried to do mobile with graalvm, or really anything, but I've heard people make apps with it and deploy them to the app store. I think you could do this without truffle though and just write Clojure bindings for the appropriate framework e.g. JavaFX
which already exist
lots of exciting stuff. it's potentially already possible, but I haven't had a chance to try the options
I have my own platform agnostic UI library that is graalvm compatible. at some point I'd like to try and compile and link it to iOS/android skia libs for making mobile apps with clojure, but I'm not sure what all the obstacles might be
@smith.adriane Ah, that's the one which also supports lanterna right?
We have tried upgrading lanterna to 3.0 for the clojure-lanterna lib here: https://github.com/babashka/clojure-lanterna
yep, and skia, skija, javafx, swing, and webgl!
ideally, it would be great to be able to mix and match (re-frame, fulcro, reagent, etc) with platform (terminal, desktop, web, and mobile, etc)