KotlinConf 2018 - Writing Your First Kotlin Compiler Plugin by Kevin Most
ฝัง
- เผยแพร่เมื่อ 30 พ.ย. 2024
- Recording brought to you by American Express americanexpres...
The Kotlin compiler plugin API gives us powerful features like Parcelize and the synthetic view accessor methods in kotlinx.android. These features could not be built using similar, but more limited, mechanisms, such as annotation processing.
The Kotlin compiler plugin API is not currently well-documented, but that doesn't mean that it can't be explored! In this talk, we start from scratch and show how we can build a compiler plugin and deploy an artifact to a public location, so that we can build plugins that can be applied as easily as the official compiler plugins.
About the Presenter:
Kevin Most is a New York City-based software engineer who is passionate about Android, and excited about Kotlin. Kevin currently works at Google on the Mobile Vision team, exploring the various applications of the image recognition libraries that power Lens and other Google vision products.
To be more precise, IrGenerationExtension and kotlin-serialization do not generate LLVM IR. IR here is internal Kotlin IR (intermediate representation). Translation from Kotlin IR to LLVM IR happens later, in the Kotlin/Native backend. In the observable future, other backends also would work with Kotlin IR so it would be sufficient to implement only IrGenerationExtension to enable a plugin on all Kotlin targets.
Is the code downloadable anywhere?
This is totally great knowledge video ....dive once in it then you never have look back. thanks you sir lot's of thank you. Kevin Most
Isnt there an api that allow me to generate kotlin code sort of like (k)apt does but allows for multiplatform? Why do I have to write bytecode thats crazy, also, that cannot even work with multiplatform since its jvm bytecode
Is the code downloadable anywhere?
github.com/kevinmost/debuglog
@@brcn thank you!
OK, but why? What functionality can be added with plugins? And what cannot be?