在guile中保存程序映像

发布于 2024-10-05 10:53:33 字数 49 浏览 2 评论 0原文

我听说大多数 Lisps 支持将正在运行的程序的图像保存到文件中。诡计支持这一点吗?

I've heard that most lisps support saving image of running program into file. Does guile support this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

可可 2024-10-12 10:53:33

我认为与其他语言的互操作对于 Guile 来说是不可或缺的,因此解释器图像中有很多状态对于 Guile 本身来说是不透明的。我最了解 Guile 的方式是使用它作为 gEDA 中内置的方案解释器,所以你能想象不仅要保存所有 CONS,还要保存 gschem 可能打开的所有 X 窗口吗?在 Guile 内部可靠地完成任务是不可行的。 (而且我不确定即使在“有限”的情况下实现“将图像保存到文件”是否是一个好主意。)

也就是说,最终您可以保存程序状态,但由于程序边界是如此多孔,随着文件描述符和内存映射从每个毛孔中泄漏出来,您很快就会意识到必须保存整个计算机的状态。但这是以“休眠”省电模式的形式完成的!我也意识到这不是你想要的。

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.

笔芯 2024-10-12 10:53:33

SBCL(Common Lisp 的一个实现)可以做到这一点。 (另请参阅简短的 SBCL 教程)。如果您有兴趣探索其他可以保存和恢复系统状态的动态语言(包括延续、打开文件描述符或其他),请查看 吱吱

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文