when JetBrains was building the new IR for Kotlin ...
# announcements
b
when JetBrains was building the new IR for Kotlin 1.4 - did they consider LLVM? I don’t know a bunch about this sorta thing so I could be asking a dumb question… just curious.
s
Considering Kotlin/Native actually uses LLVM IR, I'd say they most likely did consider it! 😛
👍 2
d
The new IR is LLVM agnostic, it more or less represents pure Kotlin. Kotlin/Native was built with the new IR infrastructure from the ground up, so yes.
1
b
cool
so then Kotlin Native is Kotlin -> Kotlin IR -> LLVM IR -> Native code? And basically anything that LLVM can target can be targeted with Kotlin?
d
Pretty much. (Assuming the runtime can fit on the target)
m
LLVM IR is probably much much much lower than the IR they built
d
Coming from someone who has played with LLVM IR. It's not that much lower. It's just a bit lower.
m
I have no clue about Kotlin IR but LLVM IR is basically like assembly with explicit stack allocation and inifite registers