Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Kotlin support #81

Open
IceBlizz6 opened this issue Oct 19, 2019 · 6 comments
Open

Kotlin support #81

IceBlizz6 opened this issue Oct 19, 2019 · 6 comments

Comments

@IceBlizz6
Copy link

Hello
I would like to advocate for Kotlin support.

I found this thread on stack overflow
https://stackoverflow.com/questions/40064479/jinq-in-kotlin-how-to-convert-lambda-into-java-serializedlambda

I encountered the same problem.
"This error sometimes occurs because your lambda references objects that aren't Serializable."

Would you still consider adding Kotlin support in the near future?
If needed i can provide a sample project.

@my2iu
Copy link
Owner

my2iu commented Oct 19, 2019

I don't think I will be able to add Kotlin support any time soon. It would probably involve a few weeks of work. Plus, on-going maintenance would be needed to ensure that Jinq tracks the latest Kotlin compiler output as Kotlin evolves. I just can't justify that sort of time commitment for this project.

@IceBlizz6
Copy link
Author

I really appreciate your work on Jinq, i'm using this library for both work and home projects.

You mentioned in the stackoverflow thread that you implemented support for Scala.
Do you think Kotlin support would require a larger time investment?
Do you know what the difference could be between Kotlin and Scala lambdas?

@my2iu
Copy link
Owner

my2iu commented Oct 21, 2019

There is support for an older version of Scala, but Scala kept changing its compiler output, and I couldn't spend the time to keep the Scala version of Jinq updated for newer versions of Scala.

Kotlin would probably require a similar time investment of a month or two in order to decompile some Kotlin lambdas and figure out how Kotlin compiles its lambdas into Java bytecode. Then a special Kotlin-variant of the Jinq API would need to be created in order to properly support the Kotlin collection library. And there might be some work involving getting things integrated with Kotlin tooling.

I haven't put in any time to decompiling some Kotlin lambdas to figure out what its output looks like, so I have no idea how it compares to Scala lambdas, or if it's even feasible to support it with Jinq.

@IceBlizz6
Copy link
Author

Thank you for the descriptive answer.
Ill keep a separate .java file in my Kotlin project for jinq.
They are compatible so this is not a complete blocker.

I mainly wanted you to know that there are some interest in this.
Perhaps in a distant future both of these languages may become more stable and popular, then it may be worth looking into this again.

@my2iu
Copy link
Owner

my2iu commented Oct 22, 2019

It's pure speculation on my part, but I think if Kotlin gets popular enough and there was strong demand for something like Jinq, the Kotlin people would probably just make their own thing. I imagine they would probably want a solution that works on Android and other platforms too, which would disqualify Jinq.

@cromat
Copy link

cromat commented Sep 18, 2020

@IceBlizz6 Another option would be QueryDSL which is quite similar. Here are some examples.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants