# About OS Library in Python

**URL:** <https://discuss.kotlinlang.org/t/about-os-library-in-python/24532>\
**Category:** Uncategorized\
**Created:** [April 4, 2022, 2:45pm UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532 "2022-04-04T14:45:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![642751484](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/642751484/32/9234_2.png) [@642751484](https://discuss.kotlinlang.org/u/642751484)\
**Post date:** [April 4, 2022, 2:45pm UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/1 "2022-04-04T14:45:19Z")

</div>

Hello all,

Is there a library in kotlin similar to OS in Python?

If it exists, it can be used to write batch scripts.

it’ll be exciting

---

<div class="post-metadata">

**Author:** ![angelos-project](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/angelos-project/32/9468_2.png) [@angelos-project](https://discuss.kotlinlang.org/u/angelos-project)\
**Post date:** [April 4, 2022, 2:53pm UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/2 "2022-04-04T14:53:20Z")

</div>

Having a similar library in Kotlin would be great, I know there are some ongoing projects trying to bring this to kotlin. I think it is important to have Kotlin/Common support for I/O, signals, sockets and simple access to the file system.

Myself has been looking into the java.nio.ByteBuffer and similar. Currently I am working on a project that requires that, that is the reason I am actually developing one myself. 😃 Look at [GitHub - angelos-project/angelos-core: Kotlin implementation of Java NIO that is Common and Native.](https://github.com/angelos-project/angelos-core)

I here by invite everyone to take a look and join if they want. I am also willing if possible to break ut code in separate subprojects to share with a larger coding community!

---

<div class="post-metadata">

**Author:** ![642751484](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/642751484/32/9234_2.png) [@642751484](https://discuss.kotlinlang.org/u/642751484)\
**Post date:** [April 4, 2022, 3:00pm UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/3 "2022-04-04T15:00:51Z")

</div>

That’s really good. I hope to finish it early

---

<div class="post-metadata">

**Author:** ![angelos-project](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/angelos-project/32/9468_2.png) [@angelos-project](https://discuss.kotlinlang.org/u/angelos-project)\
**Post date:** [April 4, 2022, 3:08pm UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/4 "2022-04-04T15:08:33Z")

</div>

Myself, first I am interested in a common buffer similar to the java.nio.ByteBuffer, also here there is a kotlin project that seem to have gotten stuck in its development [GitHub - Kotlin/kotlinx-io: Kotlin multiplatform I/O library](https://github.com/Kotlin/kotlinx-io)

Hopefully people can help me evaluate this one → [https://github.com/angelos-project/angelos-core/blob/master/libs/angelos-core/src/commonMain/kotlin/angelos/io/ByteBuffer.kt](https://github.com/angelos-project/angelos-core/blob/master/libs/angelos-core/src/commonMain/kotlin/angelos/io/ByteBuffer.kt)

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [April 5, 2022, 7:00am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/5 "2022-04-05T07:00:08Z")

</div>

What exactly do you need? Kotlin-JVM relies on java standard library and all things from python are available there.

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [April 5, 2022, 7:01am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/6 "2022-04-05T07:01:05Z")

</div>

The multiplatform io lives here: [ktor/ktor-io at main · ktorio/ktor · GitHub](https://github.com/ktorio/ktor/tree/main/ktor-io). It is not ideal, but it has most of functionality planned for kotlinx-io.

---

<div class="post-metadata">

**Author:** ![angelos-project](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/angelos-project/32/9468_2.png) [@angelos-project](https://discuss.kotlinlang.org/u/angelos-project)\
**Post date:** [April 5, 2022, 10:38am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/7 "2022-04-05T10:38:26Z")

</div>

What I don’t like is the heavy need of third party libraries on [ktor/ByteBufferChannel.kt at main · ktorio/ktor · GitHub](https://github.com/ktorio/ktor/blob/main/ktor-io/jvm/src/io/ktor/utils/io/ByteBufferChannel.kt) pulling in a lot of java dependencies. When developing my own I try to minimize the level of third-party dependencies to one or two classes on JVM side.

Also the ktor socket implementation seems to be too unseemly to me regarding all the design, and a lot of functions being JVM-only. My intention is to have the same for Native and Jvm while necessary not full support on JS. Everything I do is based on POSIX and JNI.

---

<div class="post-metadata">

**Author:** ![angelos-project](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/angelos-project/32/9468_2.png) [@angelos-project](https://discuss.kotlinlang.org/u/angelos-project)\
**Post date:** [April 5, 2022, 10:39am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/8 "2022-04-05T10:39:39Z")

</div>

Personally I want the speed and reliability of Native too, with a shared codebase in Common for my underlying business logic.

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [April 5, 2022, 11:05am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/9 "2022-04-05T11:05:20Z")

</div>

Ktor-io is fully multiplatform. “The speed and reliability of Native” is a myth. Native compilation won’t speed up your IO a lot.

---

<div class="post-metadata">

**Author:** ![angelos-project](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/angelos-project/32/9468_2.png) [@angelos-project](https://discuss.kotlinlang.org/u/angelos-project)\
**Post date:** [April 5, 2022, 11:26am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/10 "2022-04-05T11:26:05Z")

</div>

Could you tell me how to implement Noise Protocol Framework on top of ktor for Multiplatform.

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [April 5, 2022, 11:49am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/11 "2022-04-05T11:49:50Z")

</div>

The same way you would do it on top of java.nio. Ktor-io is the prototype for kotlinx-io. It includes primitives like `Input` and `Output` for streaming processing of buffers.

---

<div class="post-metadata">

**Author:** ![angelos-project](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/angelos-project/32/9468_2.png) [@angelos-project](https://discuss.kotlinlang.org/u/angelos-project)\
**Post date:** [April 5, 2022, 11:59am UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/12 "2022-04-05T11:59:46Z")

</div>

It has to be Multiplatform, then how?

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [April 5, 2022, 1:05pm UTC](https://discuss.kotlinlang.org/t/about-os-library-in-python/24532/13 "2022-04-05T13:05:52Z")

</div>

Check the link I’ve dropped above. It is all there.
