utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
586 stars 39 forks source link

Panama/all JVM languages support? #355

Closed chengenzhao closed 1 year ago

chengenzhao commented 2 years ago

Hi:

As you may know Project Panama which is the upgrade version of JNI is about to release soon. Next month(JDK 19) https://openjdk.org/projects/panama/ https://openjdk.org/jeps/424 so is it possible for this project, to use Panama to bind the Godot API to the Java world like expose Godot API as standard Java API then all the JVM language developers e.g. Scala, Clojure, Groovy etc. could use Godot to develop their games

Thanks

piiertho commented 2 years ago

Hello !

To move from JNI to Panama I think we should wait this to be in a LTS jvm release, and in major android version.
But this is not blocking for other JVM languages. In fact you can already call godot api from other jvm languages than Kotlin. You can already do it thanks to JVM languages interoperability.
What is not possible right now is to register classes that are not in Kotlin, that's not linked to the way we interact with native, but with annotation parsing. To tell godot which scripts and methods are available we parse PSI code at compile time to get registering annotations and generate entry file according to them (The entry file is here to tell engine what classes and methods are here and how to call them). We would need same component for other languages. Component to parse symbols is here : https://github.com/utopia-rise/godot-kotlin-jvm/tree/master/kt/entry-generation/godot-kotlin-symbol-processor

chippmann commented 1 year ago

Closing as answered and we're already tracking the progress of said project.