2 ms·
Yes, that is precisely what annotations are - a common unified way to attach metadata that various tools can agree upon. KSP [1] is a new addition to the kotli
by lf-non 5y ago
Yes, that is precisely what annotations are - a common unified way to attach metadata that various tools can agree upon.
KSP [1] is a new addition to the kotlin ecosystem that facilitates cross-platform annotation processing. Various annotation processors can use this metadata to generate code - the generated classes etc. will be separate entities as opposed to direct modifications to targets.
Decorators are more powerful in that they can act upon their target directly but also (usually) have runtime overhead - this overhead is one of the reasons why the js proposal had to undergo substantial revisions.
[1] https://kotlinlang.org/docs/ksp-overview.html https://kotlinlang.org/docs/ksp-overview.html