开发者

Saving program image in guile

I've heard that most lisps suppor开发者_Python百科t saving image of running program into file. Does guile support this?


I think that interoperating with other languages is pretty integral to what Guile is, and so there is a lot of state in an interpreter image that is opaque to Guile itself. I know Guile best from working with it as the scheme interpreter built into gEDA, so can you imagine having to save not just all the CONSes, but also all the X windows that gschem might have open? It just isn't feasible to do reliably from within Guile. (And I'm not sure it would be a good idea to implement save-image-to-file even in "limited" cases.)

That said, ultimately you can save the program state, but since the program boundaries are so porous, what with file descriptors and memory maps leaking out of every pore, you soon realize that you have to save the entire computer's state. This is done though, in the form of the "hibernate" power-saving mode! I realize, too, that that isn't what you want here.


SBCL, an implementation of Common Lisp, can do this. (Also see this short SBCL tutorial). If you are interested in exploring other dynamic languages that can save and restore the system state (including continuations, open file descriptors or whatever), have a look at Squeak.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜