# Rust integration / interop / compilation target?

**URL:** https://discuss.kotlinlang.org/t/rust-integration-interop-compilation-target/28674
**Category:** Uncategorized
**Created:** [May 25, 2024, 4:23pm UTC](https://discuss.kotlinlang.org/t/rust-integration-interop-compilation-target/28674 "2024-05-25T16:23:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![travisfw](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/travisfw/32/7736_2.png) [@travisfw](https://discuss.kotlinlang.org/u/travisfw)
#### Post date: [May 25, 2024, 4:23pm UTC](https://discuss.kotlinlang.org/t/rust-integration-interop-compilation-target/28674/1 "2024-05-25T16:23:16Z")

</div>

I am encountering a whole lot of Rust code lately. I probably don’t have to tell you how successfully Rust has grown in popularity and utility. It also seems to me that people who are interested in Kotlin overlap a lot with people interested in Rust. (Despite that it seems Rust and Kotlin core teams do not seem very interested in each other.) I don’t think Rust is just another potential target. I think, for social reasons, Rust could be a strategic co-evolving ecosystem, and I would like to open this thread for considering ways that Kotlin could integrate or interoperate with Rust, including utilizing crates, transpilation, packaging Kotlin code as a crate, or anything else a dev might want to do when code is written and they want to use both. Anything exist already? Perhaps my perception is wrong?

---

<div class="post-metadata">

### Author: ![kyay10](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kyay10](https://discuss.kotlinlang.org/u/kyay10)
#### Post date: [May 25, 2024, 4:31pm UTC](https://discuss.kotlinlang.org/t/rust-integration-interop-compilation-target/28674/2 "2024-05-25T16:31:19Z")

</div>

It’d be really difficult considering that Kotlin is a garbage-collected language. Kotlin already has C interop, so Rust can use that, but otherwise Kotlin has no concept of lifetimes, or Rust traits

---

<div class="post-metadata">

### Author: ![clovisai](https://avatars.discourse-cdn.com/v4/letter/c/a9adbd/32.png) [@clovisai](https://discuss.kotlinlang.org/u/clovisai)
#### Post date: [June 2, 2024, 2:59pm UTC](https://discuss.kotlinlang.org/t/rust-integration-interop-compilation-target/28674/3 "2024-06-02T14:59:08Z")

</div>

Hi! There was a talk on this topic at KotlinConf. I didn’t watch it, so I can’t you much more than that. You may want to subscribe to [https://www.youtube.com/@Kotlin/videos](https://www.youtube.com/@Kotlin/videos), they should publish the talks sometimes this month.

---

<div class="post-metadata">

### Author: ![sierisimo](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/sierisimo/32/10585_2.png) [@sierisimo](https://discuss.kotlinlang.org/u/sierisimo)
#### Post date: [June 5, 2024, 4:17am UTC](https://discuss.kotlinlang.org/t/rust-integration-interop-compilation-target/28674/4 "2024-06-05T04:17:57Z")

</div>

As mentioned by @clovisai there was a talk recently on this at Kotlinconf, it’s main focus was on a tool written by Mozilla that allows the interop but to summarize the tool does bindings with C and works as a middle man… something like: Kotlin ↔ C Bindings ↔ Rust.

This is the talk and speaker: [Link](https://kotlinconf.com/speakers/ce5f643d-771a-4b14-b504-329c50924cc3/#Crossing%20the%20barrier%20from%20Kotlin%20to%20Rust%20(and%20back)!)

The tool is called Uniffi: [Uniffi](https://mozilla.github.io/uniffi-rs/latest/) and is tool for binding rust to multiple languages. The kotlin KMP is: [GitHub](https://gitlab.com/trixnity/uniffi-kotlin-multiplatform-bindings)

I think is interesting as an idea but overall seems to bring more problems than solutions.

---

<div class="post-metadata">

### Author: ![travisfw](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/travisfw/32/7736_2.png) [@travisfw](https://discuss.kotlinlang.org/u/travisfw)
#### Post date: [August 26, 2024, 6:13pm UTC](https://discuss.kotlinlang.org/t/rust-integration-interop-compilation-target/28674/5 "2024-08-26T18:13:22Z")

</div>

Here it is, finally:

[![](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/8/887254de94b24150c2bfced7a98184f77ba15fe2.jpeg "Crossing The Barrier Between Kotlin and Rust (and back)! | Tarik Eshaq") ](https://www.youtube.com/watch?v=cUKcrfdFRqk)

Thanks Tarik Eshaq!
