Skip to content

Support Kotlin/Native in serde_generate and serde_generate_bin#86

Open
avvlas wants to merge 7 commits intozefchain:mainfrom
avvlas:kotlin-generate
Open

Support Kotlin/Native in serde_generate and serde_generate_bin#86
avvlas wants to merge 7 commits intozefchain:mainfrom
avvlas:kotlin-generate

Conversation

@avvlas
Copy link

@avvlas avvlas commented Jan 19, 2026

Summary

Currently, only Kotiln/Jvm is supported (through Java). This makes it impossible to use serde-generate for Kotlin/Native, Kotlin Multiplatform projects (basically, for any other targets than Jvm and Android).

This PR adds native Kotlin runtime and Kotlin generation:

  1. Uses Kotlin unsigned integer types (UInt, ULong, etc.)
  2. Int128 is stored as a data class with high (Long) and low (ULong)
    parts (Kotlin/Native doesn't have a BigInteger type like Java)
  3. Option<T> type is mapped to T? (Kotlin nullable type)
  4. For Tuple2 and Tuple3, Kotlin's Pair and Triple are used.
  5. The rest is similar to Java runtime

Test Plan

The code is tested in kotlin_generate.rs and kotlin_runtime.rs using kotlinc-native compiler

Added runtime for Kotlin/Native.

1. Uses Kotlin unsigned integer types (UInt, ULong, etc.)

2. Int128 is stored as a data class with high (Long) and low (ULong)
parts (Kotlin/Native doesn't have a BigInteger type like Java)

3. The rest is similar to Java runtime
@avvlas avvlas requested a review from ma2bd as a code owner January 19, 2026 11:13
Added Kotlin/Native support for serde-generate and serde-generate-bin
@ma2bd
Copy link
Contributor

ma2bd commented Jan 25, 2026

Thanks for the PR! I'll try to make some comments in the coming week or so

@ma2bd
Copy link
Contributor

ma2bd commented Feb 4, 2026

Can you propose a change to .github/workspace so that this can be tested in CI?

@avvlas
Copy link
Author

avvlas commented Feb 6, 2026

Can you propose a change to .github/workspace so that this can be tested in CI?

@ma2bd
Missed that, thank you. Done ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants