Compiler internal documentation

Hello,

I’m a student doing a MsC thesis about kotlin and optimization, and I’m interested in the internal documentation about the compiler. I was hopping to find a readme.md file in the github compiler folder (https://github.com/JetBrains/kotlin/tree/master/compiler) but unfortunately that’s not the case. I’ve searched other related sites and found the following links:

  • https://kotlinlang.org/spec/kotlincore.html contains the specification of how a kotlin compiler should work, but (correct me if I’m wrong) it doesn’t contains details about the current implementation.
  • Reading Kotlin compiler source: advices? is a similar issue about the same question, however it is a bit outdated and due to the fast development of kotlin it is possible something has been created in the meantime (in any case the notes that the user has taken are interesting).

So the question is:
Is there any documentation or specifications about how the official kotlin compiler is implemented?

Details about how the grammar is implemented, how the different steps in the compilation pipeline are structured or how the symbol table is managed, for example. (without searching manually in the source code, that is).

I’m interested on the compiler as a project, not as a tool, to be able to understand the different steps and modules in order to test and try optimizations on them.

Thank you in advance for any response. Also any pointer to where I can find related information will be appreciated.
Regards

1 Like

I don’t think there are any official docs for this. The best I know of is this which is from one of your links.
I’d suggest that you join the kotlin slack. You will probably find more knowledgable people over there that can help you with any questions.

3 Likes