On the Applicability of Annotation-Based Source Code Modification in Kotlin (Work in Progress)

Activity: Talk or presentationContributed talkscience-to-science

Description

Annotations add metadata to source code entities such as classes or functions, which later can be processed by so-called annotation processors to, for example, modify the annotated program's source code. While annotation processing has been well-explored in Java, the Kotlin community still lacks a comprehensive summary. Thus, in this paper, we summarize the main approaches available in Kotlin: (1) Compile-time annotation processing using (a)~Kotlin Annotation Processing Tool (KAPT), (b) Kotlin Symbolic Processing (KSP), or (c) writing a custom Kotlin Compiler plugin; as well as (2) load-time code modification using an agent or a custom class loader. We provide proof-of-concept implementations, discuss advantages and disadvantages, and specifically focus on how well each approach supports modifying the annotated source code. This should help developers and researchers to better decide when to use which approach.
Period22 Oct 2023
Event titleIntl. Conf. on Managed Programming Languages & Runtimes (MPLR’23)
Event typeConference
LocationPortugalShow on map

Fields of science

  • 102029 Practical computer science
  • 102009 Computer simulation
  • 102 Computer Sciences
  • 102011 Formal languages
  • 102022 Software development
  • 102013 Human-computer interaction
  • 102024 Usability research

JKU Focus areas

  • Digital Transformation