Conversation
|
Thanks for the PoC! I'll probably be only able to look into it after VDS, but I guess it doesn't become stale too quickly. |
|
I added this to my TODO list, hopefully I will be able to review during / just after my trip to Munich. |
michael-schwarz
left a comment
There was a problem hiding this comment.
Nice! I think we want to have something like this!
- My initial concern was that someone could side-step this interface by using
mandirectly, but this would then not type anymore, which is good. - I think the naming should be improved,
Make,Make2, andMake3are not intuitive. - This should come with a warning sign that everything that uses
all_globalswill potentially be very expensive, as it gets re-evaluated every time a new global appears. So one really only use this interface if there's no other way to know which unknowns to query.
@sim642: What do you think is the best way forward here? Should we merge this (after addressing the things above), and I try to use it in #2072 and see if it does what I want it to do there?
@hseidl, @arkocal, and I also started talking about something similar in the context of implementing history tokens at globals where this would be needed to tame infinite sets of things that are compat# (or, more generally, cases where it's hard to conjure up possible other unknowns, e.g., for thread ids).
Indeed, the underlying types are left completely abstract by the signature, so it's even impossible to side-step this interface when one knows which variant is being used under the hood.
I think the bigger question might be what to call the file module itself, currently it's just Also, in the current form it's quite specific to being used as
It might be better to try to at least locally merge this into #2072 and see if this does the job. If not, then it'd be better to rethink immediately than merging something useless. I'm interested in trying out if the common |
This is a quick sketch of the kind of coupling of
VandGmodules I described during today's GobCon regarding @michael-schwarz's question.To use this untested prototype, replace
in an analysis with
Then instead of
man.globalandman.sideg, use (currently not so well named/scoped)global manandsideg man.Additionally, there's
all_globals man.The generality of this interface is that
Vg.Make2could be in-place replaced withVg.Make3to switch from the extra-unknown-based trick to a map domain instead (the kind of thing used for privatizations for similar stuff). This is probably just less efficient, but such change should require no other code changes atglobal,sidegandall_globals.On the other hand, switching
Vg.Make2toVg.Makewould just removeall_globaland just be a thin wrapper against the initial approach. But all the uses ofglobal manandsideg manshould remain valid.TODO
VgMake,Make2,Make3.Either/Lift2construction from existing analyses.