Cross-Language Mod Development

SatanicSanta

New Member
Jul 29, 2019
4,849
-3
0
I haven't looked too into it yet, but JetBrains' new Kotlin language would probably be easy to write mods in, as it compiles into the JVM and is completely interoperable with Java.
 

Hlaaftana

New Member
Jul 29, 2019
304
0
0
I haven't looked too into it yet, but JetBrains' new Kotlin language would probably be easy to write mods in, as it compiles into the JVM and is completely interoperable with Java.
I'm looking into it. Looks nice, I especially appreciate the fact that they made an Eclipse plugin as well. Looks very similar to Groovy.
 

Hlaaftana

New Member
Jul 29, 2019
304
0
0
Meh. Not really interested. Doesn't really seem compatible according to my testing. From what I've concluded, doesn't really seem compatible with existing Java code. Doesn't look like it'll be easy for the end user to use these mods anyway. The language in general is not really functional (especially the Eclipse plugin), but I guess I have to give them a break since it's extremely new. Perhaps I'll wait for the language to stabilize and then try.
 

ljfa

New Member
Jul 29, 2019
2,761
-46
0
Well I guess the support in their own IDE (Idea) would be better than in Eclipse anyway
Afaik @dmillerw already has some experience with mods in Kotlin
And I wonder why it would not be compatible with Java code?
 

Hlaaftana

New Member
Jul 29, 2019
304
0
0
And I wonder why it would not be compatible with Java code?
Well, from what I understand, it doesn't compile directly into bytecode, from what I understand it reads code off of the .kt files and creates different classes based on them in a global kotlin_bin folder. There are different classes for packages, because the language does not strictly require functions to be inside classes. In fact, it hasn't worked when I put the main function inside a class. Compiling this into a jar would be a mess, the user would have to install Kotlin and set some paths etc. Kotlin in general isn't a language that I believe would be useful when Scala and Groovy exist.
 

SatanicSanta

New Member
Jul 29, 2019
4,849
-3
0
Meh. Not really interested. Doesn't really seem compatible according to my testing. From what I've concluded, doesn't really seem compatible with existing Java code. Doesn't look like it'll be easy for the end user to use these mods anyway. The language in general is not really functional (especially the Eclipse plugin), but I guess I have to give them a break since it's extremely new. Perhaps I'll wait for the language to stabilize and then try.
First of all, your tests are wrong. Kotlin works with all java APIs, and all java code.

And secondly, I've heard that they're first stable 1.0 release is supposed to be at the end of this year.

Sources: Kotlin Docs, Why Kotlin is my Next Programming Language by Mike Hearn
 

SatanicSanta

New Member
Jul 29, 2019
4,849
-3
0
Well, from what I understand, it doesn't compile directly into bytecode, from what I understand it reads code off of the .kt files and creates different classes based on them in a global kotlin_bin folder. There are different classes for packages, because the language does not strictly require functions to be inside classes. In fact, it hasn't worked when I put the main function inside a class. Compiling this into a jar would be a mess, the user would have to install Kotlin and set some paths etc. Kotlin in general isn't a language that I believe would be useful when Scala and Groovy exist.
I don't know why you think it doesn't compile into bytecode. It does.
 

Hlaaftana

New Member
Jul 29, 2019
304
0
0
My tests WERE (completely) wrong. I don't know what I was doing wrong however (might have been because i named my file with an uppercase letter, but that sounds absurd).
It DOES compile into bytecode (like this, yet the jar looks like this).
I was wrong about installing Kotlin and setting some paths in order to make it work, it looks like it has embeddable jars. Guessing you need both the kotlin-runtime and the kotlin-reflect jars, though.
I did read the docs before, didn't understand them 100%.

Looks like you're interested in the language, I'll make sure to keep that in mind