https://kotlinlang.org logo
#webassembly
Title
# webassembly
g

gbaldeck

03/05/2019, 5:40 PM
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

Svyatoslav Kuzmich [JB]

03/05/2019, 5:41 PM
Intermediate Representation of program inside the compiler
s

sdeleuze

03/05/2019, 6:02 PM
I hope there will be a dedicated deep dive in Koltin IR talk at Kotlinconf 😉
🤞 5
g

gbaldeck

03/05/2019, 9:03 PM
and what is the IR's purpose?
nm, I found this great explanation here: http://cs.lmu.edu/~ray/notes/ir/
s

Svyatoslav Kuzmich [JB]

03/05/2019, 10:29 PM
Great article! In its classification Kotlin IR is structured and tree-based.
f

Frédéric Camblor

03/06/2019, 10:33 PM
Is there a difference in meaning between IR and AST?
s

Svyatoslav Kuzmich [JB]

03/07/2019, 10:14 AM
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

Frédéric Camblor

03/07/2019, 11:02 AM
Thx for precision 👌
s

sdeleuze

03/07/2019, 11:16 AM
Super interesting indeed, thanks @Frédéric Camblor for the question and thanks @Svyatoslav Kuzmich [JB] for the response 😉