How to convert Typescript to Kotlin?

Is it possible to translate typescript codes to kotlin codes?
So that the kotlin codes can be compiled to classes and run on android devices with better performance than running original typescript on some JS engines.

Restricted syntax, usage of typescript is acceptable.

My purpose is compiling some simple react-like UI&logic (no complex api call/third party lib deps) written by JS/TS to jvm classes (translate to kotlin, then kotlinc), and load&run these classes on Android runtime.

I know AI code translator maybe a choice (like, is there anyone has practical experience?

Using Babel to get ast of tsx/jsx, then translate to kotlin, with limited syntax.

1 Like