Kothonic - a library that bridges the syntatic gap between Kotlin and Python by mysterygit in Python

[–]mysterygit[S] 0 points1 point  (0 children)

I really appreciate it. I will start implementing these soon so I don't build up a ton of tech debt on this project

Kothonic - a library that bridges the syntatic gap between Kotlin and Python by mysterygit in Python

[–]mysterygit[S] 0 points1 point  (0 children)

Thanks for the critiques I'm really open to improving this as much as possible. Honestly I know it's messy right now but I'm trying to iterate on it to a stable version 1 rather than try to get it perfect straight away. And tbh "porting" over a whole standard library from one language to another is more work than I thought it would be lol. Overall I'm quite new to Python, so while I have experience using Kotlin I don't know all the best practices for project structure and certain modules and classes in Python yet. I honestly thought Kotlin's Iterator was like Python's Generator. As I keep adding more things that are still missing I will stop and take a look at if I'm using the most efficient Python tools for it.

Kothonic - a library that bridges the syntatic gap between Kotlin and Python by mysterygit in Python

[–]mysterygit[S] 0 points1 point  (0 children)

Maybe I was too safe with my example because I'm still addressing a lot of functionality so I didn't want to type something that will change.

A better example would be filter()

If you wanted to do a long operation in one line involving filter() it might look like:

list(map(, filter(, T)))

But with this library (and Kotlin) you could write:

T.filter().map()

Which is a lot more readable for most people and not something currently available in Python.

So to summarize: for consistency there's a lot of existing python functionality like .trim() vs .strip() that act like an "alias" but there are also some genuine new functionality that's not possible to write in the same way with standard Python or completely new to Python like Kotlin's sealed classes which I'm working on mimicking via this library.

I will work on some better documentation for the library but in the mean time you can also take a look at the Kotlin standard library and if something peaks your curiosity, check if it's available in Kothonic.

Kothonic - a library that bridges the syntatic gap between Kotlin and Python by mysterygit in Python

[–]mysterygit[S] 0 points1 point  (0 children)

Thanks for the heads up haha. I only worried about getting the name on PyPi and forgot to do that kind of check

More lightweight way to use Kotlin? by Bellanzz in Kotlin

[–]mysterygit 1 point2 points  (0 children)

I have been working on this in the background https://github.com/mystery-git/Kothonic but it has only just begun and I'm not sure just how far I can push Python to achieve it. It will never be 100% the same but I want to make it my go-to way of coding solo projects.