Skip to content

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
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.

1 participant