sergey.bogolepov
12/20/2024, 2:01 PMenum
and sealed
classes, which means all types of classes are covered except tricky value
ones :D
• Added support for simple method overrides. Not-so-basic covariant and fake overrides will come later after we implement support for interfaces.
• Rolled out initial support for the @Throws
annotation by translating it to an untyped throws
.
Current Focus Areas
• Interfaces. Even though we excluded cross-language inheritance from the initial scope, interfaces remain very challenging to implement.
• Functional types (aka closures/lambdas). Recently, we merged support for the () -> Unit
type and are now expanding support for the rest of the possible signatures. We also need to ensure that throwing works properly, along with overrides. Oh man.
Glimpse into the future
For now, we are continuing to use a type system that is more or less the same as in Objective-C export (KotlinBase
as the root of the class hierarchy). However, we see limitations of this approach and a potentially better option that promises to be much more flexible: KotlinBridgeable protocol. We will not switch to it before the first public release, but it is clearly something we want to explore as soon as possible.
Thank you for following our progress—see you in the new year! 👋Anonymike
12/22/2024, 4:31 PMJavier
12/29/2024, 12:28 PMsergey.bogolepov
01/03/2025, 1:49 PMAlex Murphy
01/27/2025, 7:25 PMNever
on the swift side for my sealed class. Any suggestions?Alex Murphy
01/29/2025, 4:48 PMsergey.bogolepov
01/31/2025, 3:44 PMJavier
02/07/2025, 9:29 AMsuspend
and Flow
APIs?sergey.bogolepov
02/10/2025, 9:06 AMIs there any public doc to check how Swift Export currently works withThere is no support for them as Swift export still WIP.andsuspend
APIs?Flow
Javier
02/10/2025, 11:27 AMinterface MessengerClient {
val messages: Flow<List<Message>>
suspend fun sendMessage(content: String): Either<MessageError, Message>
suspend fun deleteAllMessages(): Either<MessageError.Unknown, Unit>
}
I would like to know how KotlinBridgeable can help to not wait for first party implementations from JetBrains or Google and I being able to create the bindings somehow.
I guess for suspend
it would be necessary a first party implementation, but for Flow
or any custom class, it should be possible with it to be created by anyone, right?sergey.bogolepov
02/11/2025, 10:32 AM@objc
and use them in Kotlin via cinterop
.
> Sadly, I cannot use Swift Export a lot as I need support for coroutines.
Yeah, that's true. Also, Swift export won't support cross-language inheritance for some time :)
> I guess for suspend
it would be necessary a first party implementation, but for Flow
or any custom class, it should be possible with it to be created by anyone, right?
We will see. Flow
is essentially a part of stdlib, so first-party support out of the box makes a lot of sense.