https://kotlinlang.org logo
#kontributors
Title
# kontributors
y

Yuku Kotani

08/22/2019, 3:08 PM
I’m reading kotlin compiler code and found that there are two kinds of intermediate representation, IR and PSI. What is difference between those?
i

Ilmir Usmanov [JB]

08/22/2019, 4:25 PM
IR is mutable, PSI is immutable. PSI is used by frontend and plugin (and every change in PSI will result in changes in source code) and IR is used by IR backends.
y

Yuku Kotani

08/22/2019, 6:16 PM
I see. So the compiler daemon keeps PSI and sync it with the kotlin code, and the compiler will generates IR from PSI then convert it to Bytecode, JS or something on build, right?
👌 1
2 Views