-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crucible-llvm: Don't pass around the symbolic backend explicitly #1185
crucible-llvm: Don't pass around the symbolic backend explicitly #1185
Conversation
dd52913
to
384e050
Compare
@RyanGlScott @kquick Any thoughts on this direction? There's a lot of instances of this to fix up so I just want to get some early feedback before going through them all. |
As it stands in this PR so-far, we are removing a call argument but re-constituting it from monadic state almost immediately. The type signatures are only slightly reduced. As presented, there doesn't seem to be a big advantage to this change; I do like the idea of minimizing dependencies of individual functions, but these functions seem to need this value anyhow, and there is perhaps a slight (miniscule? non-existent?) performance impact to retrieving the value from the monadic context. Is there the potential for this to ripple upstream: could the I'm mostly ambivalent at this point and I haven't taken a close look at the larger context (i.e. these opinions are based solely on the delta in this PR), so I may be missing the bigger perspective. I'm aligned with whichever direction you'd like to go on this PR. |
I feel the same way as @kquick. |
Yes, that was what I was thinking, we could go all the way up to Thanks for the feedback! |
One more advantage is that removing the |
ac323fa
to
a5f9594
Compare
`Lang.Crucible.Simulator.OverrideSim.{getSymInterface,ovrWithBackend}` can replace the explicit passing of `bak`. This should simplify some type signatures.
This simplifies a bunch of signatures, allows for only retrieving the backend where it's needed via `ovrWithBackend`, and brings `LLVMOverride` closer to the more general `TypedOverride`.
a5f9594
to
c05d84d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still somewhat ambivalent about this change, but only because passing explicit sym
/bak
arguments to functions that return OverrideSim
is a very common pattern in crucible
. Perhaps this shouldn't be a common pattern, but I fear that removing all uses of this pattern would take a lot more changes than the patch here.
In any case, I think the changes here are unsurprising—is there anything in this PR that deserves closer scrutiny?
I think it's likely not a great pattern. Compare to the extreme case, a function There are two counter-arguments:
I could also go both ways. I think the notion of possibly unifying I don't think anything in this PR merits closer scrutiny, it's all really straightforward. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. We are at least breaking things exclusively in an area where we already broke something (in LLVMOverride
), so crucible-llvm
users will need to adapt either way.
Lang.Crucible.Simulator.OverrideSim.{getSymInterface,ovrWithBackend}
can replace the explicit passing ofbak
. This should simplify some type signatures.