https://kotlinlang.org logo
#compiler
Title
# compiler
v

ventura

11/03/2023, 3:47 PM
If I wish to create a
kotlinc-pascal
, what is the recommended stable version to start working?
Both
compileTest
task fail for
v1.9.20
due a JDK6 dependency (both Intel i7 and Apple M1)
d

dmitriy.novozhilov

11/03/2023, 4:07 PM
If you want to fork the compiler your can use any version you want, but I recommend master
v

ventura

11/03/2023, 5:17 PM
Something that is not clear to me is when the code becomes IR
suppose I have module implemented in pascal, but I am importing it into pascal_tutorial.kt
@dmitriy.novozhilov The FHIR layer is responsible for automatically transpile the IR into kotlin methods?
p

Piotr Krzemiński

11/03/2023, 5:22 PM
@ventura sorry, I don't know what FHIR is, when working on kotlin-python I just remember modifying implementation of methods for the JS target that translate IR into a given target format
v

ventura

11/03/2023, 5:23 PM
sorry, the original message was for @dmitriy.novozhilov
d

dmitriy.novozhilov

11/03/2023, 5:25 PM
I also don't know what is FHIR is There is no such thing in the compiler
v

ventura

11/03/2023, 5:26 PM

Compiler Diagram

A long long time ago, when I was working on Intel with compilers, the idea was precompile everything to LLVM intermediate language
😂 1
This way it would be simpler test new types optimizations that were impossible on GCC
d

dmitriy.novozhilov

11/03/2023, 5:27 PM
K/Native works in the same way
v

ventura

11/03/2023, 5:28 PM
As far as I got, the transform KONAN into JS and JVM, correct @dmitriy.novozhilov
d

dmitriy.novozhilov

11/03/2023, 5:29 PM
konan is just a name for K/Native compiler The main pipeline for all platforms looks in the following way: Parse tree ->fir -> ir ->bytecode/js code/llvm
v

ventura

11/03/2023, 5:30 PM
@Piotr Krzemiński 20 years ago it was hell trying to add parallel optimizations in compile time in GCC 3.x.x
d

dmitriy.novozhilov

11/03/2023, 5:32 PM
The picture above is quite inaccurate
v

ventura

11/03/2023, 5:32 PM
@dmitriy.novozhilov so, tecnically speaking, I can do: parse tree -> fir -> • bytecode/lua • bytecode/jvm • bytecode/cil • bytecode/python
d

dmitriy.novozhilov

11/03/2023, 5:34 PM
You missed ir part All backend s lower ir to smth more similar to platform representation and then convert lowered ir into platform representation
v

ventura

11/03/2023, 5:39 PM
@dmitriy.novozhilov so each code IR code generation requires its own taylored plugin, correct?
If
FIR
was documented, it would be marvelous
d

dmitriy.novozhilov

11/03/2023, 5:43 PM
so each code IR code generation requires its own taylored plugin, correct?
Kinda. This is called separate backend
And you can not ping me every message, I'm already in this thread
v

ventura

11/03/2023, 5:46 PM
Make it works in K/N is 1000x times harder than adding it to github.com/roselyn