section-engineering-education / engineering-education

“Section's Engineering Education (EngEd) Program is dedicated to offering a unique quality community experience for computer science university students."
Apache License 2.0
364 stars 890 forks source link

[Languages] Comparing KSP and KAPT in Creating Compiler Plugins in Kotlin #7410

Closed joelkanyi closed 2 years ago

joelkanyi commented 2 years ago

Comparing KSP and KAPT in Creating Compiler Plugins in Kotlin

Proposed article introduction

KAPT is the Kotlin Annotation Processing Tool, and it’s in pretty good shape these days. If you want to be able to reference the generated code from Kotlin, you need to use KAPT. It generates annotated code in compile time.

Meanwhile, Kotlin Symbol Processing (KSP) is an API that you can use to develop lightweight compiler plugins. KSP provides a simplified compiler plugin API that leverages the power of Kotlin while keeping the learning curve at a minimum. Compared to kapt, annotation processors that use KSP can run up to 2 times faster.

In this tutorial, we will be creating a lightweight symbol processor with KSP for Android and comparing both KSP and KAPT.

Key takeaways

Article quality

KSP being new, developers are torn between using KAPT or KSP. I will try and bring out the differences so that developers can choose what processing tool they should use in their projects.

References

github-actions[bot] commented 2 years ago

👋 @JoelKanyi Good afternoon and thank you for submitting your topic suggestion. Your topic form has been entered into our queue and should be reviewed (for approval) as soon as a content moderator is finished reviewing the ones in the queue before it.

louisefindlay23 commented 2 years ago

Thank you for your response and we thank you for submitting your topic. After some careful consideration it struck us that this topic may be a bit over saturated throughout other blog sites and official documentations which cover both the topics and tutorials you've mentioned.

We typically refrain from publishing content that is covered widely on the net or other blogs. As we're more interested in original, practitioner-focused content that takes a deeper dive into programming-centric concepts.

We believe this is the best way for students to build a great portfolio (for potential employers) is by building what does not exist and what can provide the most value.

You are more than welcome to pursue another more in depth topic.