Automatically restart runtime by BrianHenryIE · Pull Request #19 · philipturner/swift-colab (original) (raw)
That’s a great idea! I tried auto-crashing before the initial Swift-Colab release circa January 2021, but it was generally unreliable. My method called into Python code inside install_swift.sh
, and I think it sometimes broke the runtime. But you seem to have found something that fixed the problem. I’ll look into it tomorrow and get that into the README ASAP!
I'm not sure where to PR the Colab notebook itself.
I would like to prevent this Python code from being automatically exposed to the user’s notebook. One option is to hide it in a special Markdown cell, but that requires clicking two cells. Some people won’t think to click the second cell. I would also have to change several test notebooks. Last but not least, it’s Python code - no way, we use Swift ;)
However, adding that as a tip on the README is a perfect idea. I can take it from here, because I have some very strict conventions for style, organization of information, etc. There is a whole Python mode to Swift-Colab, so this could serve a second purpose of auto-restarting the runtime there.
Thanks for the contribution!