So above I noticed a thread where they were talkin...
# webassembly
g
So above I noticed a thread where they were talking about Kotlin IR... what does IR stand for? Instruction Register? And what is it's purpose?
s
Intermediate Representation of program inside the compiler
s
I hope there will be a dedicated deep dive in Koltin IR talk at Kotlinconf 😉
🤞 5
g
and what is the IR's purpose?
nm, I found this great explanation here: http://cs.lmu.edu/~ray/notes/ir/
s
Great article! In its classification Kotlin IR is structured and tree-based.
f
Is there a difference in meaning between IR and AST?
s
AST is a tree representation of a code in a programming language. IR often defines its own, intermediate language. IRs can take various forms, AST is one of them. Kotlin IR is in the form of AST and it defines a new language. Kotlin IR is not a direct representation of source code: • IR must have all of its types inferred. • Kotlin has a some syntactic sugar that IR has not. It has to be desugared first. • IR has some lower-level platform constructs (static functions, class fields, etc.) that Kotlin has not.
f
Thx for precision 👌
s
Super interesting indeed, thanks @Frédéric Camblor for the question and thanks @Svyatoslav Kuzmich [JB] for the response 😉