SBTB 2015: Adriaan Moors, Does your Scala Abide?
Recording: SBTB 2015: Adriaan Moors, Does your Scala Abide?
I thought you were going to say something about larks Berg and disappoint it well anyway ask me ask me during the questions about larkspur yeah so I I come from the same category of names as well de Suisse gah if you were curious about that name from the previous talk so it's actually all day on Morse but i'm fine with Adrian it's really totally fine I'm sure Walter wouldn't mind being called wouter or something I know what that would become anyway so I'm the I'm the team lead typesafe for scala the kind of roughly two decade before i went to the dark side i think i'm just going to take this thing roughly like the decade before i went to a dark side i was in academia working for large part with martin at EPFL and the first thing i did with scala was higher kind of types type constructor polymorphism or like the crazy types and or less kind names that people give them I guess worked a bit on a pattern matcher Blissett search and so on so i've been i've been hacking the compiler for a while and so largely responsible for all the or not largely but somewhat responsible for some of the stuff that that is in there and that we would like you not to use and that's kind of why I'm redeeming myself today somewhat talking about you know how you should abide I'll try to keep my laptop awake maybe I should switch slides faster or something so work for the company currently called typesafe and I should start by some acknowledgments I actually did very little of the work that i'm going to talk about i'll try to keep up pretenses that actually know what I'm talking about but Nikola during his summer internship last year EO types a Switzerland did a great great job and I borrowed a couple slides from million drug which my colleague in Lausanne who actually led the turn ship and and and this is a great need in the community as i alluded at you know scala doesn't really tell you what not to do it's kind of proud of not restricting you and not having arbitrary restrictions which in our minds make for a simpler language because you don't have to remember a lot of the corner cases it also leads to questionable code that often are specific to you know what you're doing or where you're working or when you're working there so clearly a lot of people have felt that need and have come up with various solutions I'll start also at a couple times but we're not really talking about stuff like Scala style and Scala reform today so abide really is like your own snarky picky type checker so emphasis on type it doesn't really care about formatting it you can add all the white space and semicolons a Bible cringe but it won't it won't tell you anything yeah so um why i abide well there's lots of aspects of why why are we working on abide why should you use it we're working on abide a type-safe and i should acknowledge that we're not working on it as much as i would like because we're kind of busy with 212 and java 8 but we want to invest in in the platform side of a bite us we always do with scala tools because it's actually pretty tricky to get the rules right and i think the the tools on the previous slide did a great job of getting the rules right for their code bases but when you go look at them there's a lot of two strings and comparisons of types like begins with array and stuff like that and we just decided we couldn't take that anymore and we wanted to open up the compiler which is basically what it does to to adding your own rules and i'll show you how to do that how to write your own rules how to use abide and how to contribute to abide so as I said the platform is on us and so it's built on the scala compiler i think one of the worst things with tools like this if there is some kind of discrepancy between the language that they're that you're enforcing you know usage of and and and how you're enforcing that so you get the same view as the type checker gets in the rules in the abide rules that you can write and it's it's written to be extensible so it's meant really as a plug-in infrastructure for all your rules and that can get slow if you have hundreds of rules so we do fusion and and we do more optimization we look at like the ast nodes that your rule cares about and so we make sure we don't run it on the nodes it doesn't care about and so that's that's that's really where we want to invest I'm making sure that it's fast and correct and finally speaking of correctness you should never do to string on a type and ahead and say it begins with array just done to it don't do it please ask us if it's not clear from from after this talk how to do something like that but seriously one of the reasons why it hasn't been in a bi release yet is because these are the criteria for the first release and we've we've managed two out of three but we want to provide you with a slightly nicer layer of really common things that you want to check about your code that currently require quite intricate knowledge of the compiler and so a big part of the talk today will actually be kind of going into the rebel power mode and show you what the compiler is doing and how you can ask it for things like is this an array properly and of course um you know why abide why is it the platform why is it not you know a big phase that checks whether you're using math correctly well you know not everybody cares about that so it might change over time it might change across teams different libraries you could imagine coming with abide power packs that tell you how to use that library for example in Oaxaca or something don't use sender or whatever i'm not a any means an Akha expert so that's another reason why i buy it is designed as it is and we would like you to use it productively starting you know during your local build and you know from SB tid but we're very happy to open it up to you know let's say even aunt users which which I am I am I've done thousands I've written thousands of lines of XML and for the Scala build but he can't ask me about that during this talk you can't ever ask me about anything else so please interrupt me please Hackl just yeah like keep the Larkspur things for at the end of the talk so code review i think is an awesome opportunity and kota c is looking at that where were you know there's so many aspects of reviewing pull requests and a lot of them would be nice to get out of the way so that you can actually focus on is this part of my design like this is fit into the design there's a lot of low-hanging fruit that we could pick with abide that you wouldn't have to worry about anymore I mean there's a whole methodological kind of question around style checking that I don't want to get too deeply in today but you know we we don't see this as some kind of system to game or something it really is meant to let you easily customize let you suppress warnings that you don't want to see and give you feedback you know I would never put this as an acceptance test with like 200 rules enable then you have to meet all of them no exceptions I don't think that makes sense and so you could track metrics and have a dashboard and stuff like that and what I'm implicitly saying is here like we're not really doing any of that but your be very welcome and it would be really awesome to do stuff like that so a rule what it does is it hones in syntactically so you have some fragments of scala AST in mind and i'll show you in a minute how do how to actually write these and how to figure out how to how to code a rule like that so you look at something tactic construction at the AST level and then you ask the type checker hey what do you know about the AST what is this actually doing semantically and then i will decide whether it's doing the right thing or not according to this rule so a couple of examples to give you an idea of what i'm talking about a private field in a trait you can do it because you can you know we have all these modifiers you can put fields everywhere it doesn't make a lot of sense because given the compilation model on so this is what this would not be a rule that you necessarily activate on the Java on the JavaScript back end but on the JVM it doesn't make a lot of sense to define a private field in a trade because it will compile into a lot of public stuff I won't go into the details but just to give you an example of something that we will never kind of we can't make it in general legal in the spec because we don't really talk too much about how we have to compile this right now into the into n2 by code but for a lot of people may be that they want to rule that out unused private members who are we to say that that's a bad idea at the spec level but I can think of not very many reasons to do those and you know you can match on Asik with colon colon and sometimes that will do what you want a lot of times it will do something else and and so these rules here that I mentioned before some of them rely on understanding how your code flows I mean you could put stuff under if false and say well hey I mean this never gets executed why do I get an error for this so abide currently doesn't offer anything like that that would be awesome and you know a couple of PhDs later maybe we can get there I mean I hear Facebook is doing stuff with infer with separation logic and stuff like that so that's that's kind of the other end of the spectrum where we're not there yet so there it has to be I guess the short of this slide is it is always going to be an approximation it's always going to be kind of a way to capture your house style and to kind of prune the low-hanging fruit but they're they're OB judgment calls and there needs to be a mechanism to say hey trust me abide this is actually fine you just can't reason about it that well but I can hopefully so the first slide put some code currently this is what it looks like if you want to add a 22 SBT it'sit's we still polishing the experience there as well but you just it's up to us BTW plug in that bill then add a compiler plug into your compiler and rule packs are that's great our dependencies and the crucial bit was was off-screen but here's your nice transition I'm not a great revealed jazz coder but you know and like you just imagine not sliding in and wishing and sparkling so you need to put it in the abide configuration and those don't those obviously don't end up as a compile time dependency or anything like that it's like it's kind of like a test category or configuration for dependencies and so you can easily add your own and I'll show that during the demo so for them were serious part I guess is the of the talk will quickly kind of give you an overview of the design which is extremely complicated then will level up and kind of play around the repple and show you what the ASDs look like what the type checker can tell you and I'm sure I'll have plenty of time left for a demo where you can heckle me some more so the design obviously you have to traverse a STS we provide the the mechanisms to fuse multiple traversals that are contributed by multiple rules together and we optimized so that we don't evaluate a rule if it's never going to match anyway based purely on syntax directive is I don't know why Nikola decided to name it that way but it's just some kind of syntax I'm repository for state if you want to want it to accumulate that in your rule and then a rule as a function from treaty unit yes you're at that right to unit and again the nomenclature isn't mine there is an existential rule that is probably the most common type of rule you want to find a violation you want to say like did something wrong there so how that works is you find all the potential violations of that rule using not okay which puts in a set in the cotton your context and every time I said oh wait this is actually a correct usage you say okay this was this was a good violation so you kind of gathered a set of potential problems and then you one-by-one eliminate them and those that are left apparently were violating this rule very very many rules that you'd write in a stat tracker can be can be captured by this and so in general there are more types of rules that you can inherit from in the framework that we want to provide so we can understand how to fuse them and so on and that you don't have to keep writing you know find and exist over over trees yourself that's really what our investment and abide means like we we want you to be productive defining your rules and happy using abide so let's let's get into the into the rebel part of the talk and and this is this is where I spend a lot of my time when I'm prototyping something Paul Phillips actually implemented the the colon power thing I won't make any snarky comments about that but it's a great way you you actually get the compiler that is running in the rattle inside the rebel so it's extremely meta but and thus extremely awesome so one of the key key constructs that you'll use at least initially when you're writing your rules and abide our Kwazii quotes just you know to see who's still awake who's used a quazy quote who's never used a quazy quote who doesn't like raising their hands during talks okay just to give me a sense of what the baseline is here okay so i'll talk about it for about was that sixty percent of what i was planning to do so um i wish it was really really tall that would be so handy oh wait i have a cursor let's do that so the first part is a pattern that you're assigning the value on the right hand side to and the pattern has a placeholder for the modifiers then it specifies the keyword must be a deaf and again for the name repetition of type parameters reputation of arguments no result type and a right hand side and i'll just point out right away that that's one of the Kwazii quotes as main limitations as great as they are they're not very good at specifying that stuff is optional so this is only going to match something that has a type list of type parameters one argument list with potentially 0 to n arguments and no result type so that's one of the gotchas i guess and i should ask dennis if he's planning to do something about that or maybe i missed it because i tend to spend my time more in the end of the level below that and that i'll show you in a minute so if you if you run this under apple i'm sure no one is surprised that mods will be bound to the modifiers that have private in them the name is identity and you have a list of one type parameter and a list of one value definition if you are surprised you should probably stop me now nope not surprised great so as I said I actually spent more time with those glorious trees that are that are nicely captured by those Kwazii quotes and when you do show raw you can see what's actually going on behind the scenes there so this is a def def and everything else we've seen already accept that this is just as a lot more typing around it and I don't mean to good kind of typing but it turns out that they're pretty useful when you want to write rules that capture all possible variations of a syntactic construct if you wanted to experiment with with type checking those Kwazii quotes here's a minimal way to get to fire up the type checker this doesn't fire up a type checker that is actually liked the type checker that is type checking your code but it is pretty close it doesn't it doesn't really have the context set up because we don't have a compilation unit and blah blah blah so it won't do implicit very well but you can do this to just type check and see what happens on small small stuff so for example and I'm at any point if you don't believe me I'm happy to drop into the rebel and copy paste this and show you that it happens I don't have color coding and a rep out like here but otherwise it'll look the same so let's say you you're thinking about writing a rule about classes and methods and you know references between those methods and you want it to see what the type checker produces for you so it really just does a pretty straightforward transformation here it normalizes it so that everything has on parent at least there's a constructor there and it did some type inference for you for the for the foo and bar return types here and it elaborated the prefect's so ever you know we don't have to write this anywhere obviously but the type checker is pretty obsessive about these things so it writes them everywhere it also likes to write semicolons I don't know why that is so um I think no surprises there I think this is I mean just I'm telling you because I think this is good to know i'm not telling you like kind of jumping out of a box saying like tada look at what what what this is doing maybe where it gets a little more interesting is like behind those trees that are kind of obvious we have symbols and types symbols maintain the references between definitions and their references and the infos of symbols are like the signatures so in case of a class it'll be a class info type which will be print it like this so it'll tell you the parents the self variable definition if any and then all the members with their respective infos so that info is an important method on symbol if you want to look it look into the into the definition that the symbol represents and so every tree not every tree but most trees have a symbol and in the case of the tree to find something it's the it's the introduction of that symbol and whenever a tree refers to anything the symbol will be the symbol that it refers to kind of make sense isn't it there's there's a distinction between private members which you know are very local to the type and not inherited and everything else so that's why non-private member is is one of those internal methods in the compiler that looks into universe of of kind of yeah well known private members that are in their own category and you have to specified it it's a term or a type name like that from parched I'm the compiler care is about the distinction between types and terms and it knows where ever you write something if you're in a position that expects a term or a type so you have to be explicit about that otherwise it's not going to find the type name foo if you would if you'd write it like that mistakenly so now we get the symbol that represents the method foo and let's say then you know part of your rule wants to know which which methods refer to that method of any so you can actually just do collect on a tree and we have all the boilerplate and the compiler that traverses them and builds up you know the result of this partial function that you pass to collect and I've used I've used a quazy quote here so it's looking for all methods that are exactly like this so again if you want more general I recommend using def devs but for the initial prototype it's great to do it this way and then we know we're going to do a super simple thing I mean like we're just assuming that the right-hand side is it just one expression that top-level refers to the method that we just found out what its symbol is mainly foo so we're looking for all the methods and on the right hand side the top level expression immediately refers to foo you can imagine how you would generate this and how I would no longer fit on a slide and in that case we're going to tell you what the type of that right hand side is and I know that it's that there's just one so why don't I just you know call head directly what can go wrong and luckily since this is not an actual live coding thing nothing went wrong because I just copy paste it as once I made sure that it doesn't go wrong and you know in this stage we we know that it's it so is this is this clear as a construct does it make sense can you imagine using this in a rule and you know not using to string and comparisons between method names thank you great so one thing that is that it's also interesting to know about symbols is where they are defined or what the path is to where they are defined and oh you're just yawning I thought you had a question oh stretching ok ok ok good so obvious method what I mean to know what it does anyway but owner chain is what you need to be calling if you want to see like the whole chain of owners if you want to get a little funkier you can see things like stuff that we will never show you surface syntax slow note that the type here actually knows that it's a one like the type checker will actually track all this so that it can do constant folding and there is a sip that we're working on on exposing this because you could do a lot of interesting things with that knowledge obviously then a ubiquitous method in on types is widen which which brings it back to the most generic kind of class like type that will capture all those all those values of int and yeah again I'm showing it is because these might be like some non obvious things that you might want to know when you're writing a rule that deals with with constants or just in general because we do try always to infer the most specific type when we can internally and widen it later and now just to completely knock you out right before lunch some some base type member type as seen from fun who's ever heard of the name a scene from great that's about what I expected good keep it that way don't use essing from base type and member type I are friends base type has as a as another version base type seek and it just tells you all the classes all the super classes of a given type up to any like it'll always end at any and the key thing that is that is tricky to understand about this is that it look at the type and if it's a it's if it was a parametric type at a look at the type parameters you passed in and it will propagate them through all the way and that's actually one of the core algorithms into type checker to figure out you know yes dick yes yes yes so if you want if you were curious you know lets you know why not let's let's do this I already have my my pro color scheme rapel fired up because I didn't want to make you wait so what what type oh let me just power it up what type would you like to see well I think that's an excellent reason to show it do you have a preferred element type string not feeling very inspired okay string string I'm strong yes so let's just first see what what it does with that I have no idea why it's a slow throw because it's not plugged in and I need a new mac so that's the type you'll notice that I've been cheating all along and I haven't actually been showing you to full type there's this this this prefix in there that you really don't need to know about but the power mode and like puts the interpreter and its global which is the compiler instance in scope like this all right so probably should in preparation and let's see you feel fit yeah so you know maybe I could just do something like this man yeah don't tell people I did that okay so now we know back to back to the back to the presentation thanks very much for that question we could have picked a nicer type but ok so but you know that does it make sense or should I should I make a simpler example let me just keep it simple so this is like you know we'll show you the basic version of the problem you can see how slowly I type that's that's why we're so bad at and that's not how you do this this is why I never do a live coding dead i'll so make sense if i add if I had done a more clever version I could actually do it just more directly and use dicks favorite element type and now you can see that it knows well that's actually not super interesting but it knows that it that it has to propagate this thing in this case it's super simple but you can tell by two by two by the first line here my cursor go that it actually like knew that it's not C of T it see if int that's that's like the key thing and it does that for tight members as well it'll everything that had no statically about the type and that is fully specified but about the type you can ask about members that are now seen like this and that really like makes a whole type checker tick well I already got into demo time so I have some I have some more stuff fired up for you're already so I'm kind of I was kind of really depressed that IntelliJ already tells you this I think I don't know if you can read this but it says method foo is never used and here i was going to implement this and abide damn you IntelliJ but let's let's just do this again okay let's just do it again so this is my little demo project that's on github if you want to look at it later it's on my it's called a by demo under my under my private repository how about we started with the build so I have two projects one where I'm going to show you how how do how to develop a rule and abide and this demo here and there's a comment there that you can go explore on github that tells you about one of the many bugs that we already know of and abide in this case I think it's it's svt plugin and so for the demo you know I don't think there's anything to fascinating about it the key thing here is i think you can double click on that stuff yeah so this is how I I depend how I add a rule to abide that we're going to develop next or that you know we're going to refine next because I did do some typing already knowing a horrible am at that so this is how an SBT you would activate your personal rule package that you published and that you will be well published right here so this is this is the build for that one you depend on abide which currently is in snapshot like it isn't published at all so I published that it just did a published local of the of the repository but that's really all there is to it and you depend on the compiler at the current Scala version I I couldn't have gone to 2 12 but I decided to not venture too far because it is a demo oh and speaking of you know what Dean was saying here some XML so that was my talk no so for the if you're developing an a by plug in you you basically have to write a set of like you have to list all the classes oh and I can open this in chrome parently so you basically just you have to make this XML file it's not terribly interesting but I figured you know it's like somehow I'll show it to you so this is our fabulous rule that is going to check for unused unused private members or in general like it doesn't have to be a private member anything that you can assume the closed world for and that you will know you will see and let's see no I don't want a break point I'm just want to expand it ok so there's just very little that you need to import you have the context and you have this existential rule which is kind of like a find and and this is the boilerplate that you need to do the key that we're going to put in our path to our okay and not okay method is a symbol as it very often should be remember what I told you about strings we have to enter the name here I mean this is something you know we're in zero dot one land here so there are a couple of things that we could polish and then you can define your own warning type and it has it it does have to extend rule warning this is a little helper method that I wrote and oh thanks ontology this is local is local block its local to block now and I kind of left that there that's kind of disappoint I left it there to remind you that the compiler API is you know how you say that in those non binding contracts you know can change at any time without any kind of warning or courtesy or whatever we're so evil that we just all we do is have like weekly Sprint's where we just change bunch of names in the indicum Pilar API actually I consider doing that to show people that were serious about it and that you really should be ready to deal with brick it and another reason why I want to have a nice layer and abide that shields you from the compiler madness and gives you a bunch of methods that probably are enough but as many of you I'm sure have written macros I'm not going to ask for a show of hands because it's just too depressing you know these things tend to change and we do our best to keep them the same probably a little too much and so but this is how you would check whether a symbol is private or local to a block and there's a ton of other kind of conditions you can figure out knowing the spec to really hone in on all those symbols and and this is kind of what I'm talking about with those semantic methods that we want to provide to you in the abide framework is that you I really don't want you to have to write these things I mean this is something that we can kind of come up together just stick it in the platform and let you write a bunch of other rules that use stuff like this and that's where I see you by its role as we want to collect all this knowledge we want to you want to write that down as methods we want to do that for you so you can write the rules and use it and and so then the really the core logic obviously is is this step Val that you call it optimized McCarron and that's kind of what takes care of the fusion and and and making sure that you don't call this when you know it looks at all the cases and says oh it is only looks at selects and def deaths let's not call it when where those can't appear and then I did the most naive thing possible you know I just looked at at my my example here I said well you know let's let's find let's find all those method definitions and already kind of knew that I had to like leave the potential for type parameters and an argument list and a result type and run inside if that tree symbol is in the closed world put it aside and say this is potentially a violator gets as a private method or this is a method that I could hope to detect all usages for internally just in this project so let's let's let's let's keep it careful eye out for when this is used and then I just you know looked at how would I use such a thing and wrote down the Kwazii quote plugged in some holes and you know said well if this thing so if it's like a qualifier dot a method call you know and it and it is in this closed world thing as well that's actually an optimization you don't really have to do that then you say it's okay i've used this this this satisfies the rule that for all those symbols that are in the closed world that are defined like all the definitions of the symbols in a closed rule there must be at least one usage I think this is an obvious example of of a rule like this right this is but this I think is a pattern for many of the rules out there and so since this is a demo I should probably run some code at some point how do you make that appear again I'm kind of new in IntelliJ I've been trying to lick yeah show what would this be a turn to term huh ah left aha wonderful thank you very much this can go away now okay so i actually already started SBT because i also couldn't maybe you also know that how do you can you run like an svt task from uh-huh I did yeah okay and then it should be in a by demo I'm a I made sure to be on all the latest versions and look like a good user but I actually spent like half a caltrain right trying to figure out how to like run a task and I did task activation I think it should probably be nice and report this I think there's something wrong with the EAP or something but this is where you would expect it to be right okay so I'm not it maybe i said something up weird with my multi-project build or something okay so I don't feel too bad about using SBT console and so let's let's let's run a bite on the demo project that's how you do it it's you know abide as the name of the task and demo was what I named my project and lo and behold it works for this particularly specifically crafted use case so I mean you know need to know need to know need to the flawed but can can someone tell me thank you thank you thank wonderful so can someone tell me how sucky dis is you know give a couple of ideas of how this might break already like I've been dropping major heads about the limitations of gwazi quotes but yes multiple hands ah I guess we can't do string here sorry sorry dick and we'll do int alright let's let's try this again yeah I guess somehow that was okay ah see about that yeah so now my program is fine it's clearly used thanks it thanks so I mean I in fairness I did I did see this coming so if we if we were to figure out how to fix this I'm also very happy to take suggestions or i can just know start typing and we could go to lunch a little sooner or maybe could actually be quicker or take suggestions you've seen how poorly i type suggestions anybody how would we fix this could you yell a little louder yeah yeah yeah yeah so i mean i'm going to just get rid of all of this and basically you know that that's it oh you made made something go read here so that would be treated symbol got name yes thanks IntelliJ that's what I want I mean by the way I really like ontology I'm not in any way you know complaining my colleagues know I never do that so we have to publish our rule again and that just is a published local I didn't set up my eyes BTW build in a very sophisticated way I mean you could have done that as a dependency of course but once I published this rule locally I can just run a bite again and crash the jvm that actually is something I could repeat when I was trying this it's okay starts out pretty quickly it's nice out today oh there it is so I mean applause for the gentleman in the back we figure it out and I mean of course similar things hold here so as much as i love i really do appreciate Kwazii quotes very often you'll find that they're a great way to get you started writing a rule but using show raw you will be able to tell what the actual ASD is behind them and get the more generic case because the st is kind of designed so that you can like you know do like the common things that compilers or want to do so i'll just also show you that i know some of the names of the AST classes in there so an application in general will look like that and of course I don't know syntax for pattern matter even though i implemented it into 10 one forgets so easily kind of doing a lot of Java code and I'm just getting so actually the more general form of this of this syntax of this piece of syntax is simply an apply and let me let me just go somewhere and show you yes there so the most general form of something like this who would be you know blah de blah and then we'll use our good old blippy and i'm mixing up things we don't actually need a type description there i was thinking about definition case still so if we ask for a show raw of this it's going to get a little big but will hone in so it just trust me that this is kind of this nesting works out if you select all of this so what this really boils down to is that this is a select food meth then you go one level deeper into the tree this is a type apply where you apply a list of in this case they're still I dense because we haven't type check this and then the outer most node conveniently is the apply because that's really what this expression is doing so first you select something and you know that's by the way always that either a select or an ident at the qualifier and then well unless you do really crazy things like putting a block and a target something but you know most cases you would have a selector ignited anyway I think this was enough of a detour of a detour so this is what it would look like actually and I'm actually not going to prove that to accept if you know people want me to or if I have like tons and tons of time left I actually don't know maybe I should take more questions instead yes uh-huh uh-huh yeah like to attribute at Ref stuffs what you're talking about uh-huh yeah so that's you know as I'm sure all macro authors and in the room know is that you always start at root and you know you you make a fully qualified name and you have to be extremely careful and nice to decompile it otherwise it's just gonna stab you in the back later I actually don't have the Scala project open I think let's do that live see what happens yeah and I believe in the indexer yes well only one internal error I i am using the EAP so um okay so make attributed ref I think yes let's see oh and you know the great thing is we actually don't need anything an ID that understands I could we can just add def before that um yeah let's find find stuff there scholar flecked internal is your friend so this would be this would be the case that you're looking for and yeah unfortunately I haven't I haven't this is not intelligent fault I haven't set up the I haven't finished up I'm setting the project up again and that's really our fault for not shipping with proper IntelliJ thingies but I can probably find that one entry gin right there so this you know there's a ton of helper methods obviously in the compiler because we do this all the time and you know that is the main challenge of the macro API which I tried to call it api and the same thing holds for a buy this stuff is hard and we need your help to come up with a nice API and the way to do that my opinion is to kind of have a bunch of rules I know there are a lot of rules out there already defined and move very happy to help you port them to abide and to kind of extract the common API usage out of there and put them in a nice layer that will maintain in lockstep with the compiler so you don't have to worry about you know names changing all the time not that they do that much but this will this so this MK attribute at ref is in this case think the magic incantation to refer to a symbol on type we call those things pries for prefix okay yes ma'am join me yes this would integrate really nicely with a material materialization of scala meta in the future yeah so that's another way to deal with the abstraction layer on top of the compiler problem and I look forward to to integrating a bite or with that yes good point I should have mentioned that yeah thanks yes behind there okay so to repeat the question can a rule look at the annotations on a type or an expression well they're always on types yes absolutely the type checker sees annotations and you you get them type checked when you're running as a rule in a bite so you know exactly which symbol they refer to you don't have to look at the annotation and say is the name of the annotation there's no you can say what's the symbol for my annotation in my library and then compare symbols very quickly to find the annotations that you're looking for yes that's absolutely totally a good way to go yes should I throw the mic over to you or ah you stole that question so we're talking about this earlier that's an excellent question so the question was you know the compiler generates a lot of synthetic code behind the scenes like the getters and setters and a ton more that I prefer not to talk about how do you skip those in your rules because they actually might violate your house rules as well and so that that's very much what I had in mind when I was talking about you know I don't want you to have to care about what the compiler does and this is kind of part of the semantics API that it would want in a bite and this would probably be the number one thing that we and in this case it's a compound answer because the compiler isn't super disciplined about tracking this as I know you know but we'd like it to be and yeah so this is an area for improvement and I think this is one of the things where we can wear a bite has this kind of it can can offer you this kind of value where we will happily commit to maintaining that API so that you can write stuff on though yeah but right now there's no there's no easy way to do that I can actually show you once i get to draw desktop so this is the actual unused member rule that's in the abide repository and you know it does look at whether this symbol is synthetic and that catches most use cases there's also artifacts that are slightly different from synthetic things but I actually couldn't tell you how or why I could tell you when that was introduced and by whom but I won't so yeah anyway next question or comment or heckle or suggestion or it's time for lunch I don't know what time it is yeah yeah yeah exactly yes so the question is where did two okay and not okay come from and he suggested the answer for me thank you they come from the existential rule so I guess maybe I can give you a different kind of example and show you where they come from and how this thing is implemented so the existential rule in the abide framework that which is all written by Nicola and we forced them to document stuff and everything so you know that's the great thing about internships is uh you know there's this okay and not okay method that is contributed by them and they track state in which case is a map from the key type to whoever was put into the into the okay and not okay version right and yeah so part like we definitely can imagine that there are more kinds of rules that you would put at this layer and not in every single rule you would reimplement that logic and yeah so now I've talked a lot did I answer your question he was about to say yes or no kind of okay okay yeah let's do that mm-hmm um no there's mean you just kind of keep track and at the end of the traversal the ordering the importance of the ordering disappears because you do a full traversal of everything that you see in your closed world red and then you and then at the end you decide do they what's the intersection yeah yeah yeah you wouldn't want obviously the ordering yes and that would be that would be something that we would fix before we did an actual release so that yeah that that's and that's the kind of scrutiny that we would love for people to kind of so I mean what I do want to say that I think it's very ready to start porting rules to and using if you're willing to just publish it locally and experiment with it it is ready ready ER than many of the links i showed you earlier and just lighten my my personal opinion I will also very happily admit that it's you know zero dot one dot zero is kind of stretching it as what we imply in quality I saw multiple hands go up when I started talking again maybe that was just people wanting to God for lunch all right well thank you very much look forward to seeing rules appear in the repository or questions later have a great rest of the conference