design
design copied to clipboard
Avoiding temporal dependence
(notes extracted out of spooky action)
I think this is where poor process leaks into artefacts. By constantly running different scripts or chunks in a long-running shared R process, you create wormholes that are not explicit any where in the code.
when running several scripts or knitting several Rmds, each should get its own fresh process they should not be communicating with each other in the global workspace they should not commuunicating at all or it should be in some very obvious way, probably through the file system and perhaps a choreographing tool like make or drake And so working in projects, restarting often, etc. are a method of constantly checking for these unplanned communication channels and eradicating them.
As an outside consumer of this work, it would be particularly interesting to read about functions or features you recommend using to support these practices. I would have liked to use .rs.api.restartSession()
as an example of the kind of feature I mean, but this function does not (yet) support a "clean" restart in the way I think you mean it.
I don't think you can program your way out of this — it's a higher level workflow. But I can't yet articulate exactly what I mean by that or why it's true 😄
- https://www.youtube.com/watch?v=aqAUmgE3WyM
- "breaking the fourth wall"
Long-running SO thread of people wanting to be able to do this: Quit and restart a clean R session from within R?