This is a long shot, but thought I'd try: Just as...
# intellij
k
This is a long shot, but thought I'd try: Just as when you paste Java code into a Kotlin file, IntelliJ offers to translate it automatically into Kotlin for you, is there any plugin that can translate if you paste Python code?
h
You could write a plugin, which supports the python language and is able to map the python ast to valid Kotlin code, including keeping the semantic. While it is not impossible, having universal support is hard.
👍 1
k
Java to Kotlin is simpler because Kotlin is very much built to be a “natural” extension of Java
h
Yes, you do use the same api, the Java library as well as the same target, jvm bytecode, so there is no behavior change. Also the syntax is similar which results into readable transformed code too. Beside generating the same behavior from python with Kotlin producing readable code is another challenge.