Kotlin / dataframe

Structured data processing in Kotlin
https://kotlin.github.io/dataframe/overview.html
Apache License 2.0
761 stars 48 forks source link

Compiler plugin #729

Closed koperagen closed 2 weeks ago

koperagen commented 3 weeks ago

There are changes in core module itself to be aware of:

  1. DataRowApi.kt is related to https://github.com/Kotlin/dataframe/issues/113. Compiler plugin automatically adds DataRowSchema as a supertype to data schemas, enabling those APIs. To be continued later
  2. Changes in insert.kt. An attempt to make it work over a generic tree, in order to share implementation between compiler plugin and core library
  3. Across library added annotations that provide required meta information for compiler plugin
  4. aggregate, toDataFrame functions user to be member functions in Grouped, GroupBy interfaces. Now they are extension functions, in order for plugin to work + it's not clear why they should be member function after all

Compiler plugin module consists of three main parts:

  1. Plugin that generates extension properties, that will replace KSP plugin as it generates declarations in IDE without running a Gradle task. Related to https://github.com/Kotlin/dataframe/issues/120
  2. Plugin that adds DataRowSchema supertype to a data schema annotated declarations.
  3. Most importantly, plugin that makes it possible to elevate compile time information from function arguments to type level. Plugin updates types of DataFrame objects whenever supported (=annotated with Refine) function is called with constant arguments. Most of the code here is its implementation

Everything related to compiler plugins aimed at K2 compiler https://github.com/Kotlin/dataframe/issues/704