Does anyone know why Compose needed its own custom...
# compose
s
Does anyone know why Compose needed its own custom Kotlin compiler?
n
it needs a compiler plugin, not a new compiler
s

https://youtu.be/dtm2h-_sNDQ?t=414

it sounds like they've written a slightly different compiler to make the kotlin compose plugin, and I'm wondering why that is.
w
Afaik they modified the compiler specifically to allow compiler plugins that do what Compose needs to do (intercept & rewrite methods and method calls). Original compiler didn’t allow that. That said, it will not be a custom compiler, as the changes get upstreamed to Kotlin. So in the end it should be official Kotlin compiler and Compose compiler plugin
👍 2
s
This post by Leland Richardson explains it quite nicely, specifically the section on the
@Composable
annotation: http://intelligiblebabble.com/compose-from-first-principles/
l
@Leland Richardson [G] actually explained it very precisely during his talk at Dev Summit:

https://www.youtube.com/watch?v=Q9MtlmmN4Q0

i
great video, thnx
c
@wasyl Described this well. We are working with JetBrains to upstream the changes we need to the Kotlin compiler. We currently have the changes we need for the IDE plugin to work upstreamed. This allowed us to unify the version of Android Studio we used, so you no longer need a special version of Android Studio. We are working with JetBrains to get the back-end changes we need up streamed. Once they land, all you will need is the plugin, not a special build of the compiler.
🙏 1