Hi there, I was curious too, is the library deprec...
# arrow-meta
v
Hi there, I was curious too, is the library deprecated or just "stable"? I see the docs at the old Arrow website but not at the new one. Same with arrow-analysis
y
I believe analysis is active. Meta is kinda dead because it's near-impossible to provide some of the same APIs (although maybe the IR part can work)
r
Last attempt I did at meta and trying to implement the idea was https://github.com/arrow-kt/arrow-reflection/tree/main/arrow-reflect-annotations/src/main/kotlin/arrow/meta/samples https://github.com/arrow-kt/arrow-reflection/tree/main/arrow-reflect-compiler-plugin/src/testData The idea here is to have a form of annotation based expression and declaration macros but required porting parts of the resolution from the compiler https://github.com/arrow-kt/arrow-reflection/blob/main/arrow-reflect-annotations/src/main/kotlin/arrow/meta/TemplateCompiler.kt in order to implement the string based parser so you can use literal kotlin in macro expressions. It also requires to have a custom Transformer that runs on the checker phase https://github.com/arrow-kt/arrow-reflection/blob/main/arrow-reflect-compiler-plug[…]piler/plugin/fir/checkers/FirMetaAdditionalCheckersExtension.kt I consider those two a hack and asked the Kotlin compiler team if there was ever plan to allow FIR Transformers as part of the compiler plugin api but so far doesn't look like it. If there is a desire to have some form of arrow meta perhaps we should come up with some list of features that we would want out of it. I tried different angles but always faced limitations. Perhaps macros is too much.
As for Arrow Analysis it needs to be ported to FIR last I checked and still relies on rewinding the entire analysis phase in its current implementation.
v
Sorry, I'm new to Kotlin and out of context, are all these changes due to the Kotlin 2.0/K2 compiler release?
I'm assuming there was a lot of breaking changes?
Thanks for your answers!
r
Kotlin changed frontend formats from 1x to 2.x, the entire frontend compiler was rewritten. The old frontend was all compiler internal APIs but the new FIR frontend has some APIs to interface with the compiler. The issue is these APIs are still fairly restricted and some things like implementing "macros" in Kotlin require hacks
👍 1
There is also a new https://github.com/JetBrains/kotlin/tree/master/analysis API we may be able to leverage but haven't looked into it yet, and if it's just analysis it won't help with some metaprogramming use cases like macros
🤔 1
v
Oh, didn't know about this. I imagine it must be tough for library authors with such drastic changes, especially when it's something like arrow-meta
But it looks like the main arrow repo is alive and well, so I'm assuming y'all managed to migrate to 2.x successfully for the main parts
So basically now everything has to be done through compiler plugins, is that correct?
y
Main arrow has no reliance on arrow meta, or any compiler plugins really, so all of that is fine!
🦜 1