TLDR: Is there a *.kt parser written in Kotlin that I can use?
I have some numerical algorithms written in a restricted subset of Kotlin.
I want to automatically convert these *.kt files to *.c (to compile to wasm) and to *.cuda (the restricted subset of kotlin I am using makes the parallelism explicit).
My main problem right now is – how do I parse *.kt files (in Kotlin) in the first place ?
Question: what kotlin lirary will help me do *.kt -> abstract syntax tree
Please ignore the following off-topic discussions:
Q: Kotlin is not parallel. You can not output parallel cuda.
A: I’m using a restricted subset, which expresses individual threads.
Q: Kotlin is not low level, You can not output C.
A: Not a problem.
Q: Why not write in C/cuda directly ?
A: 1. I want to have three version: JVM, js (via Cwasm), Cuda
2. I prefer to just write in a restricted subset of kotlin.i