-
Notifications
You must be signed in to change notification settings - Fork 61
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
Evolving the API #9
Comments
I have been thinking about your suggestions. Thanks for posting. Firstly, I don't want In the current module, you call
Then if you require information about a component in future, you first consult your cache to see if you already have a suitable session for the path you are trying to load and reuse it rather than call For So I think that you can already get your desired behaviour with the existing API (at least this is how I manage it on my fork of h-i-e) The part about separating out the ghc specific helpers into a separate package I agree with, and would like to do so. |
Thanks, I think I'm seeing the design - whatever conclusions we come to, I'll volunteer to write the "semantics of cradles" documentation somewhere. To keep things concrete, let's imagine the
How are the clients mean to know that if If I ask for If I ask for If the code is broken when I start, say with a parse error, how can I then find the extend of the component? Or is that not supported? |
I think the answer to these questions is that it depends on the build system. If you are not using a build system then if one of your modules has a parse error then there is no way to know the complete module graph. If you are have a project which has a The concept of a "component" is also an artificial one created by a build tool. Your tricky questions about how components should be handled by how the build tool wants to map files to components. The responsibility for creating the right environment for a file to be loaded into belongs to the build tool. Cabal has been famously reticent to add multi-component targets because it is not predictable how combining things like I think you are right that the cradle needs to report something about what should require it to be reloaded. Just as in |
Agree it depends on the build system, but I think it would be good to pin down what Cabal should do, since what I'm really trying to figure out is what the semantics of cradles are using Cabal as an example. In particular, you seem to be assuming that Public1.hs and Public2.hs have the same set of flags, but I see no reason to expect that with your definition of the semantics of cradles, and given the lack of caching, actually checking is probably prohibitive. |
I am having a hard time coming up with anything precise to say about this. You would expect all files in a component to be in the same cradle but is that anything other than an expectation? |
After discussions:
We should also add CC @fendor |
How is the |
@mpickering if there is no config file it returns Nothing and you would call |
hie-bios
is great, but I think the current API doesn't quite address our needs. Inhie-core
we're driving it in slightly odd ways. After brainstorming internally, our thoughts around an API are:The main changes from the existing API are that we cradleFlags to be vastly cheaper, caching its work so that we can call it on every key stroke. We also introduce cradleTargets, which is essential for a bunch of refactoring use cases, and also more generally for rapid feedback.
Assuming that plan seems reasonable, we're happy to help with some of the heavy lifting to make it work. As part of the refactoring, I'd also suggest separating
hie-bios
fromhie-ghc-helpers
- sohie-bios
no longer depends on the GHC API or includes those helper functions.CC @cocreature @mpickering @alanz
The text was updated successfully, but these errors were encountered: