Hello, I'm thinking about writing a compiler plugi...
# compiler
x
Hello, I'm thinking about writing a compiler plugin to transpile kotlin to another language, but most tutorials and videos I find around that are several years old. Is there a more recent documentation, maybe more specifically around the code generation step, i.e. converting IR into a custom language?
Alternatively, is the IR to JS compiler plugin open sourced somewhere?
e
it's all open source but it's not set up for plugging in other frontends or backend easily
#python has some work to compile Kotlin to Python, which you might be interested in for your target
x
Oh nice I'll go take a look
🙏 🙏
d
Alternatively, is the IR to JS compiler plugin open sourced somewhere?
It is not a compiler plugin, it's a compiler backend You can find sources in a main Kotlin repo
x
Oh indeed wrong wording
b
Why not just use #ksp since you're only generating stuff and not manipulating IR. The docs nd api for ksp are much easier to work with.
x
Yes I saw a project that does that with python, I'll going to look in this direction
@Big Chungus
ksp
is not a good solution, as it doesn't gove me access to the code itself. I can access Class delcarations, function signatures and fields types, but I don't have access to statements, loops etc…
b
Ah, yes. Didn't think of that.