Hi all! I'm newbie with compilers / bytecode etc a...
# compiler
b
Hi all! I'm newbie with compilers / bytecode etc and I'm playing with Kotlin compiler plugin api, Is there any example of generating a new function by another function in a existing Kotlin class using plugins? (is it possible to do that with Kotlin compiler api?)
r
No docs yet but Arrow Meta does that
We are currently developing to allow easy subscription to compiler phases and high level template DSL with the Kotlin model where you can expand and generate new declaration in string templates at all levels. It supports interception of the AST prior to type checking, synthetic resolution, IR generation DSL and soon IDEA integration where the IDE automatically understands all the code you have generated based on the AST tree diff from the original sources. This will serve to Arrow as a meta platform for building tooling and compiler plugins that enrichen the Kotlin type system with stronger guarantees in some use cases. It’s all opt in as a compiler plugin where you can turn features on and off via gradle or maven config
👍 2
f
Sounds very exciting!
b
Kotlin compiler extensions are really powerful and would be great something like that to make it easy! Thank you @raulraja! I'll have a look in higher kind plugin example.
r
Ping me if you are interested in the internals or getting involved, my goal for the rest of this year is make documented metaprogramming first class in Kotlin and so is that of others in Arrow and 47 that needs some of this tooling for the upcoming arrow companion libraries
🙌 1
👍 1
p
Hello, @raulraja! Is js target supported?
r
Arrow Meta uses IR by default which when it’s finished it’s supposed to be multiplatform including JS
👍 1