LISP解释器与LISP图像之间的区别和关系是什么?它们可以用作同步吗?

发布于 2025-01-26 15:30:36 字数 128 浏览 1 评论 0原文

我注意到有些人使用这些术语,就好像它们是同步一样。

例如,在同一情况下,我听到“将此功能添加到评估它的LISP映像”和“将此功能评估到LISP解释器中以稍后使用”。

但是,我不确定在技术上使用是否精确。因此,问题。

I noticed some people using the terms as if they were synonoms.

For instance, in the same scenario, I heard "add this function to the lisp image evaluating it" and "eval this function into the Lisp interpreter to use it later".

However, I am not sure the use is technically precise. Thus, the question.

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

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

发布评论

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

评论(3

一曲爱恨情仇 2025-02-02 15:30:36

这是两个正交概念。让我们从通常综合的

LISP图像 n。公共LISP 实现的运行实例。 A lisp image 的特征是单个地址空间,其中任何对象可以直接涉及与此规范符合此规范的其他任何一个,以及单个共同的,全球环境

因此,关键的想法是,图像是一组相互引用的LISP对象(功能和数据),可以在程序的执行过程中“访问”或“访问”。

执行通用LISP程序的方式取决于实现系统的方式。例如,可以通过机器语言的汇编或通过某种形式的解释(甚至两者的混合)来执行它。因此,LISP解释器只是执行实现的一种特殊方式(在当前的通用LISP系统中,有许多不同的方法可以实施该语言)。

These are two orthogonal concepts. Let’s start from the usually comprehensive Common Lisp Glossary:

Lisp image n. a running instantiation of a Common Lisp implementation. A Lisp image is characterized by a single address space in which any object can directly refer to any another in conformance with this specification, and by a single, common, global environment.

So the key idea is that an image is a set of mutually referring Lisp objects (functions and data) that can be “called” or “accessed” during the execution of a program.

The way in which a Common Lisp program is executed depends instead from the way in which a system is implemented. It could be executed by compilation in machine language, for instance, or through some form of interpretation (or even a mix of the two). So a Lisp interpreter is just a particular way in which an implementation is done (and in the current Common Lisp systems there are many different ways to implement the language).

甚是思念 2025-02-02 15:30:36

图像

“图像”是磁盘上的文件。

“向图像添加功能”

表示评估功能并保存图像,因此如果在下一个调用中立即可用的功能。

复制

“解释器”(通常)是错误的抽象水平;一个人应该使用
改为“ repl”。例如,SBCL根本没有解释器(所有内容始终汇编),但这不是与此主题相关的细节。

“将此功能评估到LISP解释器中以稍后使用”

表示在当前替补中评估该函数,并在相同的过程中使用它(即,可以使用直到重新启动LISP)。

Image

"Image" is a file on disk.

"Add a function to the image"

means evaluate the function and save the image, so the function if immediately available on the next invocation.

REPL

"Interpreter" is (usually) a wrong level of abstraction; one should use
"REPL" instead. E.g., SBCL does not have an interpreter at all (everything is always compiled) but this is not a detail that is relevant to this topic.

"eval this function into the Lisp interpreter to use it later"

means evaluate the function in the current REPL and use it in the same process (i.e., it is available until Lisp is restarted).

撩心不撩汉 2025-02-02 15:30:36

图像是写入磁盘(或另一个辅助存储)的Lisp Heap 的副本。 LISP堆是计算机RAM中数据存储的内存。要将LISP堆写入图像,请停止运行的LISP,并将内存倾倒到磁盘上。然后恢复LISP或退出。

启动新的LISP时,该图像可用于还原堆。这通常比开始新的LISP然后加载相应的软件要快。

A LISP解释器是一个从源执行LISP程序的程序。许多LISP实现不使用解释器,但是它们执行了编译的LISP代码,通常是将LISP代码编译为本机机器代码。

An image is a copy of a Lisp heap written to disk (or another secondary storage). The Lisp heap is the memory for data storage in RAM of a computer. To write a Lisp heap to an image, the running Lisp is stopped and the memory is dumped to disk. Then the Lisp is either resumed or quit.

The image can be used to restore the heap upon starting a new Lisp. That's usually faster than starting a fresh Lisp and then loading the corresponding software.

A Lisp interpreter is a program which executes Lisp programs from source. Many Lisp implementations don't use an interpreter, but they execute compiled Lisp code, typically Lisp code compiled to native machine code.

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