I had asked this in another thread but it got a bi...
# compiler
k
I had asked this in another thread but it got a bit buried; we know that the compiler team is working on a new IR for Kotlin so we can write cross-platform compiler plugins. Is there anywhere that we can track that work? Either a bunch of Youtrack tickets, a branch or directory in the Github repo containing the latest work, etc.
βž• 9
g
Probably until a new IR backend is not released for each platform it’s too early discuss plugins
k
Yeah, it would be good to know the progress of the IR backend so we can know when the plugin frontend might be coming πŸ™‚
g
Progress in percent? %) If you check master brach, you will see quite a lot of commits related to IR for JS and JVM
k
Maybe something like a fuzzy percentage. It's hard for me to intuit, from looking at the commits, how much work has been done for the IR and how much still remains
d
Right now it's a bit early to talk about stable plug-in API.
d
How about un-stable plug-in API? πŸ™‚
d
There are at least 3 IR-based compiler plug-ins in active development, one of them outside of JB. Can't say that the plug-in development process is convenient, though.
k
Could you cite them? πŸ™‚ I assume the cross-platform Kotlin serialization plugin is one of them
d
Another is Kotlin indexing plug-in used by Google internal tooling. At least one more is [developed internally at yet another big software company for its own dark purposes I can't really discuss].
Most of the work in the backends and IR right now is about getting IR stable and getting back-ends feature complete. There's a rather big multi-platform story we have to support (with stuff like incremental compilation and so on). Right now it's somewhat hard to track, because the stuff we work on is going through iterative design refinement. It will converge on some iteration, you just can't tell in advance on which one :)
πŸ‘ 2
k
great, thanks for weighing in on this. I know that such a large effort is tough to track because you're kind of laying the tracks down as the train rolls forth πŸ™‚
u
It's not the most meaningful metric, but currently the JVM IR backend passes ~65% of several thousand code generation tests for the old backend. For JS IR, this number is over 90% already AFAIK. But don't draw any conclusions from these numbers :) I also agree with Dmitry that it's too early to discuss any progress on the plugin API.
πŸŽ‰ 5
s
It is closer to 97% of code generation tests for JS IR backend, but tooling integration is not quite there yet.
d
(I know these numbers aren't of any strict measurement or so but...) Where would you say the percentages are now?
πŸ‘€ 2
u
Today 5659/6455 tests pass on JVM IR, which is about 87%. This includes tests on isolated execution, inlining, bytecode text and JVM signatures (for some reason I only included the execution tests in the original metric 5 months ago). We still have a lot to do though, as we're only starting to compile any sort of real projects and finding problems there.
πŸ‘ 2
πŸ™ 2
d
Thanks for the update!
☝️ 1
Hello again, (it's been another 5 months) where would you say the percentages are now? (Also, if you don't mind, is there a way for muggles to easily check this?)
πŸ‘€ 2
u
7564/7815, 96%. The way to check this would be to checkout the Kotlin project, change
InTextDirectiveUtils.isIgnoredTarget
to
return false
, and run
./gradlew cleanTest :compiler:test --tests <http://org.jetbrains.kotlin.codegen.ir.Ir|org.jetbrains.kotlin.codegen.ir.Ir>*
. Alternatively you could construct a regex to count the number of
IGNORE_BACKEND: JVM_IR
+ number of
IGNORE_BACKEND_MULTI_MODULE: JVM_IR
directives, minus
IGNORE_BACKEND_FIR: JVM_IR
, and run it on
compiler/testData/codegen
.
πŸ‘ 2
d
Thanks for the update and the instructions!