[wild idea] Compiler plugin to support any dimension
- Dominant language
- Kotlin
- Stars
- 734
- Forks
- 51
- Avg merge
- 9h 52m
- Merged PRs (30d)
- 6
Description
While Multik supports https://github.com/Kotlin/multik/blob/develop/multik-core/src/commonMain/kotlin/org/jetbrains/kotlinx/multik/ndarray/data/Dimensions.kt up to 4 type-safe dimensions, it might be cool to attempt to make a K2 compiler plugin that can support any number of dimensions based on what the user creates.
It's just a wild idea, of course, but I believe it to be possible. It would certainly show the strength of the Kotlin 2.0 compiler while enhancing matrix multiplications at the same time :)
In some cases it could even simplify the maintainability, as you'd no longer have to write each operating for 1, 2, 3, 4, and n dimensions, just once for n.
Contributor guide
Research direction
Start with multik-core/src/commonMain/kotlin/org/jetbrains/kotlinx/multik/ndarray/data/Dimensions.kt and review how the current type-safe dimensions and per-dimension operations are represented. Determine the scope and feasibility of a K2 compiler plugin for user-defined dimension counts; done would require an agreed design and a working implementation that supports arbitrary dimensions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100