It’s completely different approach to use Kotlin M...
# multiplatform
g
It’s completely different approach to use Kotlin MPP, so it’s not easy to answer, you should understand what it provides for you The biggest thing that you cannot write common UI using Kotlin MPP like you do with QT
r
Kotlin mpp is use to share the common code (models , business logic etc). I can create Mpp library and people can use it in their native environment (jar for JVM , .so file for linux, .DLL file for Windows etc) And QT I can write UI common. But also the business logic can be common. So is there is benefit that I create Kotlin mpp lib. And use it QT .
g
It’s a bit strange approach. Why do you need for exmaple Jar? Do you want to share this library with other clients?
But also the business logic can be common
You also can write business logic on QT
I mean of course, for me, write C++ wouldn’t be good idea, but if you already have QT, not sure why would you need K/N for business logic
also even for such thing as models, you cannot just use K/N model as interface or class of C++, it will be C API
r
As I said I figuring Benefits for using Kotlin mpp lib using in my organisation. Only benefit I can see. If I want to share my Lib with other native platforms (JVM, JS). And use that lib in QT too. But if they are targeting Different platforms with QT only. Then there is no need for it. It rather make two different codebase
I am just pondering over the benefits.
g
IMO To evaluate benefits you need strong use case
if you want to share it with other platforms, it make sense IMO, especially for some business logic
Back to your original question:
So is there is benefit that I create Kotlin mpp lib
Benefit that you can use it on other platforms obviously, including QT using C bindings
otherwise you cannot, writing C++ and use it from JVM would be quite painful IMO, and even do not talk about JS, which is also possible in theory but even less pleasant
r
That's the only plausible benefit that Kotlin-mpp could do the organisation using QT
g
Not really sure what you expect, Kotlin MPP created exactly for this: to share some common code using native platform technology, it generates JVM bytecode, JS or native with C bindings
if you don’t want to share with other platforms, what the point to use it?
and it’s not really related to QT at all
yes, you can use K/N from QT as C library, but it’s actually the only connection
r
Actually I was asked to demonstrate benefit of using K/N . And my org uses QT for creating apps. (So c++ is no difficulty) And I could only come up with benefit of sharing the lib with platforms. I wanted to know is there any other use case ?
g
benefit of using K/N
Benefit it something related to use case, not absolute thing
And I could only come up with benefit of sharing the lib with platforms.
If you have such use case it’s benefit, if you don’t than… no benefit
and it relate to MPP
r
Benefit it something related to use case, not absolute thing
Hmm. I understand. Then it was the only use case I could come up with actually. 😅