Kotlin compilers in general
First, let's make sure we are on the same page and have a basic understanding of how compilers and the Kotlin compiler work in general.
A compiler is a program that translates computer code in a given programming language into machine code or lower-level code. Compilers generally consist of two components:
- Frontend
- Backend
A frontend compiler deals with programming-language specifics, such as parsing the code, verifying syntax and semantic correctness, type checking, and building up the syntax tree. Generally, there is one frontend compiler and as many backend compilers as there are targets.
A backend compiler takes an intermediate representation (IR) of the code that's produced by the frontend compiler and creates an executable based on the IR. This can be run on the specific target while running certain optimizations.
In Kotlin, there are three different backend compilers: one for each of the Java virtual machine ...