跳至主要内容

Kotlin 的 Google Summer of Code 2023

This article contains the list of project ideas for Google Summer of Code with Kotlin 2023.

備註

Google Summer of Code 2023 has already ended. If you want to participate in GSoC 2024, check out this list of project ideas.

Project ideas

Kotlin Multiplatform protobufs [Hard, 350 hrs]

Description

Add support for Kotlin/Common protos to protoc with Kotlin/Native (iOS) runtime and Objective-C interop.

Motivation

While protobufs have many platform implementations, there isn't a way to use them in Kotlin Multiplatform projects.

Expected outcomes

Design and build Kotlin Multiplatform Protobuf support, culminating in contributions to:

Skills required (preferred)

  • Kotlin
  • Objective-C
  • C++

Kotlin Compiler error messages [Hard, 350 hrs]

Description

Add improved compiler error messages to the K2 Kotlin compiler: more actionable and detailed information (like Rust has).

Motivation

Rust compiler error messages are often regarded as being by far the most helpful of any compiler. The Kotlin K2 compiler provides a great foundation for better compiler errors in Kotlin but this potential is somewhat untapped.

Expected outcomes

Using StackOverflow and other data sources, uncover common compiler errors which would have significant value to users. Make contributions back to the compiler to improve those error messages.

Skills required (preferred)

  • Kotlin
  • Compiler architecture

Kotlin Multiplatform libraries [Easy or Medium, 175 or 350 hrs]

Description

Create and deliver (to Maven Central) Kotlin Multiplatform libraries that are commonly needed. For instance, compression, crypto.

Motivation

Kotlin Multiplatform is still fairly new and could use some additional libraries which are either platform independent (Kotlin/Common) and/or have platform implementations (expect/actual).

Expected outcomes

Design and deliver at least one Kotlin Multiplatform library with a greater priority on JVM/Android and Kotlin/Native (iOS) than other targets (Kotlin/JS).

Skills required (preferred)

  • Kotlin
  • Objective-C

Groovy to Kotlin Gradle DSL Converter [Medium, 350 hrs]

Description

The project aims to create a Groovy-to-Kotlin converter with a primary focus on Gradle scripts. We will start from basic use cases, such as when a user wants to paste Groovy-style dependency declarations to a Kotlin script and the IDE automatically converts them. Later, we will start supporting more complex code constructs and conversions of complete files.

Motivation

The Kotlin Gradle DSL is gaining popularity, so much so that it will soon become the default choice for building projects with Gradle. However, many documents and resources about Gradle still refer to Groovy, and pasting Groovy samples into build.gradle.kts requires manual editing. Furthermore, many new features around Gradle will be in Kotlin first, and consequently users will migrate from the Groovy DSL to the Kotlin DSL. The automatic code conversion of a build setup will therefore greatly ease this migration, saving a lot of time.

Expected outcomes

A plugin for IntelliJ IDEA that can convert Groovy code to Kotlin with the main focus on the Gradle DSL.

Skills required (preferred)

  • Basic knowledge of Gradle
  • Basic knowledge of parsers and how compilers work in general
  • Basic knowledge of Kotlin

Eclipse Gradle KTS editing [Medium, 350 hrs]

Description

Improve the experience of editing Gradle Kotlin Scripts (KTS) in Eclipse.

Motivation

IntelliJ IDEA and Android Studio have great support for editing KTS Gradle build scripts, but the Eclipse support is lacking. Ctrl-Click to definition, Code completion, Code error highlighting could all be improved.

Expected outcomes

Make contributions to the Gradle Eclipse plugin that improve the developer experience for editing KTS.

Skills required (preferred)

  • Kotlin
  • Gradle
  • Eclipse platform and plugins

Improve support for parameter forwarding in the Kotlin Plugin for IntelliJ IDEA [Medium, 350 hrs]

Description and motivation

The Kotlin plugin provides Kotlin language support in IntelliJ IDEA and Android Studio. In the scope of this project, you will improve parameter forwarding support for the plugin.

To prefer composition over inheritance is a widely known principle. IntelliJ IDEA provides great support for writing code that uses inheritance (completion and quick-fixes the IDE suggests), but the support for code that uses composition instead of inheritance has yet to be implemented.

The main problem of working with code that heavily uses composition is parameter forwarding. In particular:

  • The IDE doesn't suggest completing parameter declarations that can be forwarded as arguments to other functions that currently use default arguments.
  • The IDE doesn't rename the chain of forwarded parameters.
  • The IDE doesn't provide any quick-fixes that fill in all the required arguments with parameters that can be forwarded.

One notable example where such support would be greatly appreciated is Jetpack Compose. Android’s modern tool kit for building UI, Jetpack Compose heavily uses function composition and parameter forwarding. It quickly becomes tedious to work with @Composable functions because they have a lot of parameters. For example, androidx.compose.material.TextField has 19 parameters.

Expected outcomes

  • Improved parameter and argument completion suggestions in IntelliJ IDEA.
  • Implemented IDE quick-fixes that suggest filling in all the required arguments with parameters with the same names and types.
  • The Rename refactoring renames the chain of forwarded parameters.
  • All other IDE improvements around parameter forwarding and functions that have a lot of parameters.

Skills required (preferred)

  • Knowledge of Kotlin and Java
  • Ability to navigate in a large codebase

Enhance the kotlinx-benchmark library API and user experience [Easy, 175 hrs]

Description

kotlinx-benchmark is an open-source library for benchmarking multiplatform code written in Kotlin. It has a barebones skeleton but lacks quality-of-life features, such as fine-grained benchmark configuration (like time units, modes), feature parity between JVM and Kotlin/Native benchmarking, a command-line API, and modern Gradle support. Its documentation, integration tests, and examples are also lagging.

Motivation

The library has already been implemented, but it is sometimes difficult to use correctly and confuses some users. Improving the library’s user experience would greatly help the Kotlin community.

Expected outcomes

  • The library has clear documentation with usage examples.
  • The library API is simple and easy to use.
  • Options for benchmarking Kotlin/JVM code are also available for benchmarking code on other platforms.

Skills required (preferred)

  • Kotlin
  • Gradle internals

Parallel stacks for Kotlin Coroutines in the debugger [Hard, 350 hrs]

Description

Implement Parallel Stacks view for Kotlin coroutines to improve the coroutine debugging experience.

Motivation

Currently, support for coroutines debugging is very limited in IntelliJ IDEA. The Kotlin debugger has the Coroutines Panel that allows a user to view all of the coroutines and their states, but it's not very helpful when debugging an application with lots of coroutines in it. The JetBrains Rider has the Parallel Stacks feature that allows a user to inspect threads and their stack traces in a graph view, which could be a great way of inspecting coroutines.

Expected outcomes

Using the Kotlin coroutines debugger API, develop the IntelliJ IDEA plugin which would add the parallel stacks view for coroutines to the debugger. Find ways to improve the graph representation of coroutines.

Skills required (preferred)

  • Kotlin
  • Kotlin coroutines
  • IntelliJ IDEA plugin development

```markdown
本文包含 Google Summer of Code with Kotlin 2023 的[專案構想清單](#project-ideas)。

:::note
Google Summer of Code 2023 已經結束。
如果您想參與 GSoC 2024,請查看[此專案構想清單](gsoc-2024#project-ideas)。

:::

## Project ideas

### Kotlin Multiplatform protobufs [Hard, 350 hrs]

**Description (描述)**

為 protoc 新增對 Kotlin/Common protos 的支持,並支援 Kotlin/Native (iOS) 執行時和 Objective-C 互通性 (interop)。

**Motivation (動機)**

雖然 protobufs 有許多平台實作,但沒有辦法在 Kotlin Multiplatform 專案中使用它們。

**Expected outcomes (預期成果)**

設計並建構 Kotlin Multiplatform Protobuf 支援,最終貢獻於:
* [GitHub – protocolbuffers/protobuf: Protocol Buffers – Google's data interchange format](https://github.com/protocolbuffers/protobuf)
* [GitHub – google/protobuf-gradle-plugin](https://github.com/google/protobuf-gradle-plugin)
* [Kotlin Multiplatform Gradle Plugin](https://plugins.gradle.org/plugin/org.jetbrains.kotlin.multiplatform)

**Skills required (preferred) (所需技能(首選))**

* Kotlin
* Objective-C
* C++

### Kotlin Compiler error messages [Hard, 350 hrs]

**Description (描述)**

為 K2 Kotlin 編譯器新增改進的編譯器錯誤訊息:更具可操作性和更詳細的資訊(就像 Rust 那樣)。

**Motivation (動機)**

Rust 編譯器的錯誤訊息通常被認為是所有編譯器中最有幫助的。
Kotlin K2 編譯器為 Kotlin 中更好的編譯器錯誤提供了一個很好的基礎,但這種潛力在某種程度上尚未開發。

**Expected outcomes (預期成果)**

使用 StackOverflow 和其他資料來源,找出對使用者具有重大價值的常見編譯器錯誤。
對編譯器做出貢獻,以改進這些錯誤訊息。

**Skills required (preferred) (所需技能(首選))**

* Kotlin
* Compiler architecture (編譯器架構)

### Kotlin Multiplatform libraries [Easy or Medium, 175 or 350 hrs]

**Description (描述)**

建立並交付 (到 Maven Central) 常見需要的 Kotlin Multiplatform 函式庫。
例如,壓縮、加密。

**Motivation (動機)**

Kotlin Multiplatform 仍然相當新,並且可以使用一些額外的函式庫,這些函式庫是平台無關的 (Kotlin/Common)
和/或具有平台實作 (`expect`/`actual`)。

**Expected outcomes (預期成果)**

設計並交付至少一個 Kotlin Multiplatform 函式庫,其中 JVM/Android 和 Kotlin/Native (iOS) 的優先順序高於
其他目標 (Kotlin/JS)。

**Skills required (preferred) (所需技能(首選))**

* Kotlin
* Objective-C

### Groovy to Kotlin Gradle DSL Converter [Medium, 350 hrs]

**Description (描述)**

該專案旨在建立一個 Groovy 到 Kotlin 的轉換器,主要重點是 Gradle 腳本。
我們將從基本用例開始,例如當使用者想要將 Groovy 樣式的依賴宣告貼到 Kotlin 腳本中時,IDE 會自動轉換它們。
稍後,我們將開始支援更複雜的程式碼結構和完整檔案的轉換。

**Motivation (動機)**

Kotlin Gradle DSL 越來越受歡迎,以至於它很快將成為使用 Gradle 建構專案的預設選擇。
但是,許多關於 Gradle 的文件和資源仍然參考 Groovy,並且將 Groovy 範例貼到 `build.gradle.kts` 中需要手動編輯。
此外,Gradle 的許多新功能將首先出現在 Kotlin 中,因此使用者將從 Groovy DSL 遷移到 Kotlin DSL。
因此,建構設定的自動程式碼轉換將大大簡化這種遷移,從而節省大量時間。

**Expected outcomes (預期成果)**

一個 IntelliJ IDEA 插件,可以將 Groovy 程式碼轉換為 Kotlin,主要重點是 Gradle DSL。

**Skills required (preferred) (所需技能(首選))**

* Basic knowledge of Gradle (Gradle 的基本知識)
* Basic knowledge of parsers and how compilers work in general (對剖析器和編譯器如何工作有基本了解)
* Basic knowledge of Kotlin (Kotlin 的基本知識)

### Eclipse Gradle KTS editing [Medium, 350 hrs]

:::note
[Read the blog post about this project](https://kotlinfoundation.org/news/gsoc-2023-eclipse-gradle-kotlin/)

:::

**Description (描述)**

改善在 Eclipse 中編輯 Gradle Kotlin 腳本 (KTS) 的體驗。

**Motivation (動機)**

IntelliJ IDEA 和 Android Studio 對於編輯 KTS Gradle 建構腳本有很好的支援,但 Eclipse 支援不足。
Ctrl-Click to definition、Code completion、Code error highlighting 都可以改進。

**Expected outcomes (預期成果)**

為 Gradle Eclipse 插件做出貢獻,以改善編輯 KTS 的開發人員體驗。

**Skills required (preferred) (所需技能(首選))**

* Kotlin
* Gradle
* Eclipse platform and plugins

### Improve support for parameter forwarding in the Kotlin Plugin for IntelliJ IDEA [Medium, 350 hrs]

**Description and motivation (描述與動機)**

The [Kotlin plugin](https://github.com/JetBrains/intellij-community/tree/master/plugins/kotlin) provides Kotlin language support in IntelliJ IDEA and Android Studio.
In the scope of this project, you will improve parameter forwarding support for the plugin.

To prefer composition over inheritance is a widely known principle.
IntelliJ IDEA provides great support for writing code that uses inheritance (completion and quick-fixes the IDE suggests),
but the support for code that uses composition instead of inheritance has yet to be implemented.

The main problem of working with code that heavily uses composition is parameter forwarding.
In particular:
* The IDE doesn't suggest completing parameter declarations that can be forwarded as arguments to other functions that currently use default arguments.
* The IDE doesn't rename the chain of forwarded parameters.
* The IDE doesn't provide any quick-fixes that fill in all the required arguments with parameters that can be forwarded.

One notable example where such support would be greatly appreciated is Jetpack Compose.
Android’s modern tool kit for building UI, Jetpack Compose heavily uses function composition and parameter forwarding.
It quickly becomes tedious to work with `@Composable` functions because they have a lot of parameters.
For example, `androidx.compose.material.TextField` has 19 parameters.

**Expected outcomes (預期成果)**

* Improved parameter and argument completion suggestions in IntelliJ IDEA.
* Implemented IDE quick-fixes that suggest filling in all the required arguments with parameters with the same names and types.
* The **Rename** refactoring renames the chain of forwarded parameters.
* All other IDE improvements around parameter forwarding and functions that have a lot of parameters.

**Skills required (preferred) (所需技能(首選))**

* Knowledge of Kotlin and Java
* Ability to navigate in a large codebase

### Enhance the kotlinx-benchmark library API and user experience [Easy, 175 hrs]

:::note
[Read the blog post about this project](https://kotlinfoundation.org/news/gsoc-2023-kotlinx-benchmark/)

:::

**Description (描述)**

`kotlinx-benchmark` 是一個用於對用 Kotlin 撰寫的多平台程式碼進行基準測試的開放原始碼函式庫。
它有一個簡陋的骨架,但缺乏生活品質功能,例如細粒度的基準測試配置(如時間單位、模式),
JVM 和 Kotlin/Native 基準測試之間的功能對等性、命令列 API 和現代 Gradle 支援。
其文件、整合測試和範例也落後。

**Motivation (動機)**

該函式庫已經實作,但有時難以正確使用,並且會讓一些使用者感到困惑。
改善函式庫的使用者體驗將極大地幫助 Kotlin 社群。

**Expected outcomes (預期成果)**

* The library has clear documentation with usage examples.
* The library API is simple and easy to use.
* Options for benchmarking Kotlin/JVM code are also available for benchmarking code on other platforms.

**Skills required (preferred) (所需技能(首選))**

* Kotlin
* Gradle internals

### Parallel stacks for Kotlin Coroutines in the debugger [Hard, 350 hrs]

:::note
[Read the blog post about this project](https://kotlinfoundation.org/news/gsoc-2023-parallel-stacks/)

:::

**Description (描述)**

Implement [Parallel Stacks](https://www.jetbrains.com/help/rider/Debugging_Multithreaded_Applications.html#parallel-stacks) view
for Kotlin coroutines to improve the coroutine debugging experience.

**Motivation (動機)**

Currently, support for coroutines debugging is very limited in IntelliJ IDEA.
The Kotlin debugger has the [**Coroutines Panel**](debug-coroutines-with-idea#debug-coroutines) that allows a user to view all of the coroutines and their states,
but it's not very helpful when debugging an application with lots of coroutines in it.
The JetBrains Rider has the [Parallel Stacks](https://www.jetbrains.com/help/rider/Debugging_Multithreaded_Applications.html#parallel-stacks) feature
that allows a user to inspect threads and their stack traces in a graph view, which could be a great way of inspecting coroutines.

**Expected outcomes (預期成果)**

Using the Kotlin coroutines debugger API, develop the IntelliJ IDEA plugin which would add the parallel stacks view for coroutines to the debugger.
Find ways to improve the graph representation of coroutines.

**Skills required (preferred) (所需技能(首選))**

* Kotlin
* Kotlin coroutines
* IntelliJ IDEA plugin development