Skip to content

Kotlin DataFrame compiler plugin #704

Open
@koperagen

Description

@koperagen

Place for discussion and questions about Kotlin DataFrame compiler plugin

Idea behind it is to make such code compile, provide coding assistance in project files and later in Kotlin Notebooks - on top of already existing code generation in-between notebook cells

@DataSchema
data class WikiData(val name: String, val paradigms: List<String>)

fun main() {
    val df = dataFrameOf(
        WikiData("Kotlin", listOf("object-oriented", "functional", "imperative")),
        WikiData("Haskell", listOf("Purely functional")),
        WikiData("C", listOf("imperative")),
    )
    val df1 = df.add("size") { 
        paradigms.size // `paradigms` is generated based on WikiData class structure
    }
    // `size` property is generated based on `add` argument
    df1.size.print()
}

Demo project that you can clone and run
https://github.com/koperagen/df-plugin-demo

Issue that describes required compiler API and provides some information about use case
https://youtrack.jetbrains.com/issue/KT-65859

Metadata

Metadata

Assignees

Labels

Compiler pluginAnything related to the DataFrame Compiler PluginenhancementNew feature or requestresearchThis requires a deeper dive to gather a better understanding

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions