跳到主要内容

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 已经结束。 如果你想参与 GSoC 2024,请查看 this list of project ideas

Project ideas

Kotlin Multiplatform protobufs [难度:高,350 小时]

描述

为 Kotlin/Common protos 添加对 protoc 的支持,包括 Kotlin/Native (iOS) 运行时和 Objective-C 互操作。

动机

虽然 protobufs 有许多平台实现,但没有办法在 Kotlin Multiplatform 项目中使用它们。

预期成果

设计并构建 Kotlin Multiplatform Protobuf 支持,最终贡献给:

所需技能(首选)

  • Kotlin
  • Objective-C
  • C++

Kotlin Compiler error messages [难度:高,350 小时]

描述

为 K2 Kotlin 编译器添加改进的编译器错误消息:更具可操作性和更详细的信息(如 Rust 那样)。

动机

Rust 编译器错误消息通常被认为是所有编译器中最有帮助的。 Kotlin K2 编译器为 Kotlin 中更好的编译器错误提供了一个很好的基础,但这种潜力尚未被充分利用。

预期成果

使用 StackOverflow 和其他数据源,发现对用户具有重要价值的常见编译器错误。 为编译器做出贡献以改进这些错误消息。

所需技能(首选)

  • Kotlin
  • 编译器架构

Kotlin Multiplatform libraries [难度:简单或中等,175 或 350 小时]

描述

创建并交付(到 Maven Central)常用的 Kotlin Multiplatform 库。 例如,压缩、加密 (crypto)。

动机

Kotlin Multiplatform 仍然相当新,可以使用一些额外的库,这些库要么是平台独立的 (Kotlin/Common),要么具有平台实现 (expect/actual)。

预期成果

设计并交付至少一个 Kotlin Multiplatform 库,其中 JVM/Android 和 Kotlin/Native (iOS) 的优先级高于其他目标 (Kotlin/JS)。

所需技能(首选)

  • Kotlin
  • Objective-C

Groovy to Kotlin Gradle DSL Converter [难度:中等,350 小时]

描述

该项目旨在创建一个 Groovy 到 Kotlin 的转换器,主要关注 Gradle 脚本。 我们将从基本用例开始,例如当用户想要将 Groovy 风格的依赖声明粘贴到 Kotlin 脚本时,IDE 会自动转换它们。 稍后,我们将开始支持更复杂的代码结构和完整文件的转换。

动机

Kotlin Gradle DSL 越来越受欢迎,很快就会成为使用 Gradle 构建项目的默认选择。 但是,许多关于 Gradle 的文档和资源仍然引用 Groovy,并且将 Groovy 示例粘贴到 build.gradle.kts 中需要手动编辑。 此外,Gradle 的许多新功能将首先出现在 Kotlin 中,因此用户将从 Groovy DSL 迁移到 Kotlin DSL。 因此,构建设置的自动代码转换将大大简化这种迁移,节省大量时间。

预期成果

一个 IntelliJ IDEA 插件,可以将 Groovy 代码转换为 Kotlin 代码,主要关注 Gradle DSL。

所需技能(首选)

  • Gradle 的基本知识
  • 解析器和编译器如何工作的一般知识
  • Kotlin 的基本知识

Eclipse Gradle KTS editing [难度:中等,350 小时]

描述

改善在 Eclipse 中编辑 Gradle Kotlin 脚本 (KTS) 的体验。

动机

IntelliJ IDEA 和 Android Studio 对编辑 KTS Gradle 构建脚本有很好的支持,但 Eclipse 的支持不足。 Ctrl-Click 跳转到定义,代码补全,代码错误高亮都可以改进。

预期成果

为 Gradle Eclipse 插件做出贡献,以改善编辑 KTS 的开发者体验。

所需技能(首选)

  • Kotlin
  • Gradle
  • Eclipse 平台和插件

Improve support for parameter forwarding in the Kotlin Plugin for IntelliJ IDEA [难度:中等,350 小时]

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 [难度:简单,175 小时]

描述

kotlinx-benchmark 是一个用于对 Kotlin 编写的多平台代码进行基准测试的开源库。 它有一个最基本的主干,但缺乏生活质量 (quality-of-life) 的功能,例如细粒度的基准测试配置(如时间单位、模式), JVM 和 Kotlin/Native 基准测试之间的功能对等,命令行 API 和现代 Gradle 支持。 它的文档、集成测试和示例也比较落后。

动机

该库已经实现,但有时难以正确使用,并且会使一些用户感到困惑。 改善库的用户体验将极大地帮助 Kotlin 社区。

预期成果

  • 该库具有清晰的文档和使用示例。
  • 该库 API 简单易用。
  • 用于对 Kotlin/JVM 代码进行基准测试的选项也可用于对其他平台上的代码进行基准测试。

所需技能(首选)

  • Kotlin
  • Gradle 内部原理 (internals)

Parallel stacks for Kotlin Coroutines in the debugger [难度:高,350 小时]

描述

实现 Parallel Stacks 视图,用于 Kotlin 协程,以改善协程调试体验。

动机

目前,IntelliJ IDEA 中对协程调试的支持非常有限。 Kotlin 调试器具有 Coroutines Panel,允许用户查看所有协程及其状态, 但在调试具有大量协程的应用程序时,它并不是很有帮助。 JetBrains Rider 具有 Parallel Stacks 功能, 允许用户在图形视图中检查线程及其堆栈跟踪,这可能是检查协程的好方法。

预期成果

使用 Kotlin 协程调试器 API,开发 IntelliJ IDEA 插件,该插件将为调试器添加协程的并行堆栈视图。 寻找改善协程图形表示的方法。

所需技能(首选)

  • Kotlin
  • Kotlin 协程
  • IntelliJ IDEA 插件开发