Saving a stack?

I'm just wondering if it is possible to upload all the variables and the current state of the program to a file, and then restore them to another computer? Let's say that I have a small program in Python or Ruby, taking into account a certain condition, it will output all the current variables and the current state to a file.
Later, I could download it again, on another machine, and return to it.
Something like a VM snapshot function.
I saw such a question here, but is related to Java, saving the current JVM and running it again in another JVM. Most people said that there was nothing like this, only Terracotta had something, still not perfect. Thanks.

To clarify what I'm trying to achieve:
Given 2 or more Raspberries Pi, I try to run my software on Pi nΒΊ1, but then when I need to do something with this, I need to move the software to Pi nΒΊ2 without dataloss, only a slight break time.
And so on, to an unlimited number of cars.

+6
source share
3 answers

Good question.

In Smalltalk, yes.

In fact, in Smalltalk, dumping the entire program and restarting it is the only way to store and share programs. There are no source files, and there is no way to start the program from scratch. So in Smalltalk you get the free version.

Smalltalk VM offers a hook where each object can register to restore its external resources after a restart, for example, reopening files and Internet connections. But also, for example, whole arrays are registered on this hook in order to change its value in the case when the dump was transferred to the machine with different accuracy.

This can give an idea of ​​how difficult (or not) it can make us achieve this in a language that does not support renewable design dumps.

All other languages, alas, live much less. With the exception of some Lisp implementation, I would not know a single language that supports resuming from a memory dump.

This is a missed opportunity.

+1
source

I saw Mariano demonstrate that using Fuel (object serialization) in Pharo Smalltalk at a recent Esug conference. You can continue debugging and running until you click objects that are not serialized. Squeak smalltalk runs on Pi, and if saving the image is enough for you, this is trivial. We are still waiting for a faster JITting VM for ARM (part of the Google Summer of Code program)

0
source

All Articles