This repository was archived by the owner on Jan 2, 2021. It is now read-only.
Repository navigation
Switch back to bytecode - #873
Merged
Merged
Conversation
Collaborator
Author
|
Benchmarks aren't too bad! (From CI) |
Collaborator
|
Kudos @wz1000 I hope the community will appreciate all your work on getting TH to work properly with ghcide. I will review tomorrow. |
pepeiborra
approved these changes
Oct 18, 2020
| instance NFData GetModIface | ||
| instance Binary GetModIface | ||
|
|
||
| data GetModIfaceWithoutLinkable = GetModIfaceWithoutLinkable |
Collaborator
There was a problem hiding this comment.
Do we want GetModIface and GetModIfaceWithoutLinkable,
or GetModIface and GetModIfaceWithLinkable?
Collaborator
Author
There was a problem hiding this comment.
I don't know, this way is more consistent with GetModIface and GetModIfaceWithoutTimestamps. If you feel otherwise, we can change it.
The only place where it makes a difference is when defining new Rules (since it can save recomputation if the linkable changed but the iface hash remained the same). If it is just used with runIdeAction or something, then there shouldn't be any difference.
pepeiborra
reviewed
Oct 18, 2020
pepeiborra
pushed a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
* Switch back to bytecode * return a HomeModInfo even if we can't generate a linkable * set target to HscNothing * add rule for GetModIfaceWithoutLinkable * use IdeGlobal for compiled linkables
pepeiborra
pushed a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
* Switch back to bytecode * return a HomeModInfo even if we can't generate a linkable * set target to HscNothing * add rule for GetModIfaceWithoutLinkable * use IdeGlobal for compiled linkables
pepeiborra
pushed a commit
to pepeiborra/ide
that referenced
this pull request
Dec 29, 2020
* Switch back to bytecode * return a HomeModInfo even if we can't generate a linkable * set target to HscNothing * add rule for GetModIfaceWithoutLinkable * use IdeGlobal for compiled linkables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I think this is the best option left now.
There are a couple of feasible alternatives I can think of:
Use a hybrid strategy, using object code the first time we compile and bytecode all subsequent times. This should be easy to implement after this PR, it would require just a two line change in
getLinkableType. We can also generate object code (but not use it) on save. This will hopefully result in faster startup and less memory usage at boot, but as files are changed, memory usage will quickly climb to and surpass the bytecode only strategy (since the object code will be loaded in and we can't unload it).I think it should be possible to serialize core to iface files, taking hints from ezyang/ghc@13615ca. For this scheme to be backwards compatible with older GHCs, I think could be possible to sneak in the Core Bindings as
[IfaceRule]in themi_rulesfield of theModIface, giving the rules some special names that could be filtered out by ghcide and used to reconstruct theModGutsFixes #854, #672 , #858