-
Notifications
You must be signed in to change notification settings - Fork 97
Conversation
Benchmarks aren't too bad! (From CI)
|
Kudos @wz1000 I hope the community will appreciate all your work on getting TH to work properly with ghcide. I will review tomorrow. |
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.
@@ -290,6 +303,12 @@ instance Hashable GetModIface | |||
instance NFData GetModIface | |||
instance Binary GetModIface | |||
|
|||
data GetModIfaceWithoutLinkable = GetModIfaceWithoutLinkable |
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.
Do we want GetModIface
and GetModIfaceWithoutLinkable
,
or GetModIface
and GetModIfaceWithLinkable
?
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 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 use
d with runIdeAction
or something, then there shouldn't be any difference.
* 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
* 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
* 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
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_rules
field of theModIface
, giving the rules some special names that could be filtered out by ghcide and used to reconstruct theModGuts
Fixes #854, #672 , #858