godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 96 forks source link

Add Kotlin Multiplatform support for Android and iOS #1263

Closed cagdasc closed 4 years ago

cagdasc commented 4 years ago

Describe the project you are working on: Godot have new plugin system for Android. But there is not plugin system for iOS except GDNative. I do not work on this but Can the new plugin v1 system improve with Kotlin Multiplatform?

Describe the problem or limitation you are having in your project: Mobile developers need to be 3rd-party libraries for improve their apps. Some of them are ad libraries, Facebook integration, game services etc. With this integration Android and iOS apps can be same.

Describe the feature / enhancement and how it helps to overcome the problem or limitation: With this feature we can create plugin for iOS apps.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: There is no code it's only proposal.

If this enhancement will not be used often, can it be worked around with a few lines of script?: There is no script it's only proposal.

Is there a reason why this should be core and not an add-on in the asset library?:

idoby commented 4 years ago

Is any major library written in Kotlin for iOS?

cagdasc commented 4 years ago

@idoby there are some libraries like KTor, kotlinx.serialization, you can find any of this at Google.

shayneoneill commented 4 years ago

Native callouts tend to be about platform specific things. Wouldn't improved swift interop be a more useful plan and easier to implement than what effectively amounts to a new and somewhat redundant (In the "more than one" sense, no aspertions against Kotlin meant, its a neat little language) platform

cagdasc commented 4 years ago

@shayneoneill I don't think completely understand you but you are right Swift implementation is more efficient. I said Kotlin because it has multiplatform support. I want to tell what I imagined with this diagram. It copied from Android v1 plugin system. I want to examine the possibility of this work. Probably my first step is create an individual framework and compile Godot source with it. Untitled Diagram(1)

cagdasc commented 4 years ago

I did first step. Create a framework and compile godot source with it. After create a demo project and compile it with my framework and custom build godot export template. Next step is create another framework represented by plugin and using some reflection. @Calinou can you direct me a point of contact about this idea? I want to know is this idea useful(I think useful) and true approach.

Calinou commented 4 years ago

@cagdasc I guess you should ask @m4gr3d about it.

cagdasc commented 4 years ago

I have create a plugin framework(Compiled Plugin Output) and add it godot project export. After initialize singleton in gdscript and finally I have call plugin method from gdscript. Thank you.

@m4gr3d @Calinou

Calinou commented 4 years ago

@cagdasc That's good to hear :slightly_smiling_face: Is this proposal still relevant now?

cagdasc commented 4 years ago

@Calinou only plugin part is relevant.

cagdasc commented 4 years ago

@m4gr3d I have completed basic implementation. Code needs to be some refactoring. After that I want to code review for start to next steps.

cagdasc commented 4 years ago

I created more related and detailed new one. #1364