https://kotlinlang.org logo
#arrow-meta
Title
# arrow-meta
t

tschuchort

11/04/2019, 8:39 PM
Really this stuff should be part of the Kotlin docs. Swift has so much better documentation on the compiler
2
K 1
a

amanda.hinchman-dominguez

11/04/2019, 8:39 PM
ugh, RIGHT
They kind of do, they kind of don't. They have a cookbook and some drawings, but what I've been doing is cross-referencing academic papers and other resources with what the cookbook says because the cookbook totally lacks context
Future diagrams will show you how Arrow-meta is inserting itself and giving you the window (the access to the "soul") of the Kotlin compiler
t

tschuchort

11/04/2019, 8:42 PM
Which cookbook do you mean?
a

amanda.hinchman-dominguez

11/04/2019, 8:43 PM
They have a cookbook that kind of glosses over only one part of the compiler in regards to the IntelliJ Platform, and they spend a lot more time talking about the code structure for the IDE plugin than they do about how it works with the Kotlin compiler: https://www.jetbrains.org/intellij/sdk/docs/basics/architectural_overview/general_threading_rules.html
I'm thinking that I'm going to open up a repo for my compiler research so that others may look into it/share it
All this research has taken up much of my last few days, but I think I'm really glad I slowed down to look into this. I feel like I can work a lot faster if I understand the bigger picture
t

tschuchort

11/04/2019, 8:48 PM
Yeah, this will really help understand how everything fits together. I was thinking about contributing to arrow-meta but don't really know where to start with all the knowledge about compiler internals that is required and my limited time.
r

raulraja

11/04/2019, 8:53 PM
@tschuchort specially I'd like to discuss with you how compiler-test can help test the compiler plugins phases
a

amanda.hinchman-dominguez

11/04/2019, 8:54 PM
@raulraja @tschuchort I'm definitely interested! I'm a n00b
t

tschuchort

11/04/2019, 8:55 PM
I'm interested but I'm not sure that I can put in the time it takes to get results in a reasonable timeframe (still haven't finished that annotation-processing library I started over a year ago 🙃)
Maybe something related to testing would be a way for me to make a meaningful contribution without having to allocate so much time to it
a

amanda.hinchman-dominguez

11/04/2019, 8:56 PM
@tschuchort If it makes you feel better, at this point, I'm heavy lurking on arrow-meta - I haven't even made a real contribution yet. I've been experimenting with irDump although we all got stuck last week with some funky testing behaviors
r

raulraja

11/04/2019, 8:59 PM
Regarding to testing I’m thinking along the lines of: - compile-test enhances it’s support for compiler plugins by exposing to tests all phases the compiler exposes extension points for: Analysis, IR etc… - compile-test generates an in the fly plugin that subscribes to those phases and exposes them in tests assmbling the jar and passing it through the compilation process or making the test folder a compiler plugin on it’s own. If we had that we can test the meta the Quote system, or diagnostic suppression or anything the Kotlin compiler does
You can even use Arrow Meta to subscribe easily to the phases when we have snapshots
Ultimately meta needs to provide users the ability to to test phases and create plugins right on the tests.
If you are ever interested in these features we could help build them too.
t

tschuchort

11/04/2019, 9:07 PM
That sounds like something I could do.
compile-test enhances it’s support for compiler plugins by exposing to tests all phases the compiler exposes extension points for
How exactly would this look from the user's point of view? We can already pass
ComponentRegistrar
instances directly to the compiler (i.e. define local compiler plugins in a test).
r

raulraja

11/04/2019, 9:14 PM
How do you do that? I miss that
if that is the case that is all you need
t

tschuchort

11/04/2019, 9:24 PM
It's not merged yet but practically finished.
Like I said, we would need to know the initialization order of kapt and third-party plugins to be sure that it works. Or we can just merge it right now and hope for the best (and fix it later if problems arise)
r

raulraja

11/04/2019, 9:31 PM
we can serve as test bed
I’d love to have that support ASAP because that is the remaining piece we need
t

tschuchort

11/04/2019, 9:34 PM
Ok, unless @Foso has any objections I will merge it then and you'll have to complain if there's any problems
j

jereksel

11/04/2019, 9:45 PM
Cool idea about these meetups. Recently I was also learning compiler plugins from different direction - synthetic stuff. Mostly for optics.
I've managed to create synthetic object inside data class with extension function for generic type, so I'm pretty close.
Unfortunately imports are still required, but I will be looking for ideas to fix it.
a

amanda.hinchman-dominguez

11/04/2019, 9:49 PM
I was in a meeting just now with Rafa but I will be sure to get through all of this info!
2 Views