-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Use racket -y
in racket-run
?
#730
Comments
Yes. Actually there's a 10 year old, double-digit issue number #41. 😄 As I mentioned in a comment there, I stumbled across https://github.com/rmculpepper/custom-load as an example of a way (or the way) to go about this. I think I never did it, so far, just because:
So that's a quick brain dump (sorry) but I think that indicates you nudged my interest and I'm willing to explore this, finally, after 10 years. 😄 |
p.s. I had a sloppy understanding of
So your feature request IIUC is to maintain Whereas the idea with #41 using So I guess there are at least two distinct feature ideas to consider here? I'll keep re-loading my brain with details... |
To clarify: The status quo is that The status quo is based on the idea that, for many projects, it's fine to compile from source. For other projects, a In any case, it's left up to the user when/how to compile, if at all. The And so, personally, for some projects I might have a Part of me likes that division of labor, and is starting to feel conservative like I have the past 10 years. 😄 But I still have an open mind. Another idea is that there already exists an Emacs |
Thanks @greghendershott for sharing all that context -- I think it makes sense at a high level 😄 Having |
At one extreme, for the Racket Mode project itself, I never compile (except as part of By contrast, for stuff like projects using Typed Racket, that compile-time type-checking can be slow enough to want to avoid redoing it, i.e. cache in Actually, after a good night's sleep, I'm kind of warming up to the idea of doing both features, because they solve different problems:
I think each would be harmless, and furthermore could be behind a customization flag. The default for each (on or off) idk yet; TBD. So I'll mull this more. Meanwhile, if you do achieve some success (or failure) with |
I didn't really understand the difference between the two options you mentioned and wanted to read a bit more about it. Having done so, I still can't say I understand anything as I'm not able to reproduce most of the cases I was hoping to 😭. But for what it's worth, this is my present understanding of the options: First, a relevant excerpt from the docs for
This makes me think that running I thought to set up an experiment to try and reproduce the different scenarios that may be at play here. Say there are two modules Cases:
I'm assuming What do we expect to happen in each of these cases when we run In (1) everything works fine and there are no surprises. On the subject of (2), the
So it sounds like in case (2), we might get a "link: module mismatch" error. Although I've seen link mismatch errors in the past, I wasn't able to reproduce one in this experimental setting. In any event, based on the docs, it sounds like this is the case that @rmculpepper's For case (3), based on the above docs, it doesn't sound like I was thankfully able to reproduce this case in the It sounds like adding support for In (4), it seems like both In sum, my impression is that supporting |
re: using Emacs's
I think that works? Adding it to
... which makes me wonder whether the module could end up being But doing it in two steps (i.e. |
Well, it's not really equivalent. The closest equivalent isn't Each Racket Mode back end (normally there's one) consists of Each |
I understand it's annoying. OTOH the UX reflects the reality that compiling to I think one thing to keep in mind is that, IIUC, Racket always compiles if there is no Footnotes
|
Yes, that sounds right to me. One thing that has confused me in the past is that uncompiled modules take way longer to run, and that has sometimes inflated benchmarks, like these for the In that case, it would seem that if the downstream module is ever stale, it will always behave correctly when run, since it will be recompiled, and transitively compile dependencies.
I would say case (3) above. Upstream module is modified but not recompiled. Downstream module continues to use the stale zo file since the zo files are mutually consistent. I find this is a common case (e.g. change source code and then re-run tests. These days I use
In most cases I encounter in practice it usually takes seconds, so not too long. But as we would be spending this time in any case with That is, assuming a module is stale and already has a |
Thanks for the summary. On first read that all sounds good. Also:
So a fair number of things to think through and implement correctly. Good news is there's precedent/examples from DrR for nearly all of this. |
Are you familiar with
racket -y
? I understand that it basically compiles not only the file supplied as an argument, but also any modules in the dependency chain (and just those modules and nothing extra) that have been modified since they were last compiled (the "y", according to the official docs, stands for-y, --make Yes, enable automatic update of compiled files
😄 ). I find it to be a reliable way to run any module and be sure that it reflects the actual current behavior including all upstream changes, without having to manually recompile a lot of stuff.Would it make sense for
racket-run
to exhibit this kind of-y
behavior by default, or potentially via adefcustom
, or a separate command likeracket-update-and-run
? (Or is there already a way to do this? I didn't immediately see anything in the docs. edit: @soegaard on Discord kindly pointed out what appears to be the place in the source where files are run, but we didn't know what exactly this implies re: compilation of modules).Ever since learning about
racket -y
, I've actually been assuming thatracket-run
already uses it, as it seems to take more time to run the buffer when an upstream module has been changed, but thinking again, that delay is likely due to Racket determining that the compiled version of the upstream code is stale, and falling back to using the uncompiled modules (without recompiling them). But in today's Qi meeting we noticed that modifying an upstream module and thenracket-run
ing the downstream one wasn't actually resulting in the change being picked up. But runningracket -y <module>
at the command line did reflect the changes.Using
-y
would likely also end up addressing the delay withracket-run
ning modules with changed module dependencies, as it should end up recompiling those modules instead of falling back to the uncompiled ones.The text was updated successfully, but these errors were encountered: