10

I have noticed that people often act as though Scheme and Racket are the same thing here on Stack Overflow (and also elsewhere on the web. For example, questions about Scheme often generate solutions in Racket. If you take a look at the questions tagged , you'll see that half of their answers start with #lang racket.

Are these two languages really so similar that they can be considered to be equal? Is Racket just an extension of Scheme (i.e. Scheme code will always run on a Racket interpreter)?

I want to underline the fact that this is not a polemic, just a question from someone studying Scheme programming language.

4

2 回答 2

14

Racket 与 Scheme 非常接近,事实上直到两年前它还被称为 PLT Scheme。

然而,Racket 中使用的默认语言在一些地方与 Scheme 不同(最值得注意的是它具有不可变对)。这并不是什么新鲜事:当它被称为 PLT Scheme 时,它​​也有类似的差异。它也不是 Racket 独有的东西:Scheme 标准非常简约,以至于他们定义的语言是不切实际的,这意味着所有的 Scheme 实现都添加了自己的扩展。Racket 案例中的另一个重要点是定义新方言非常容易——并且 Racket 实现了严格的 R5RS 方言(严格意味着它不是很有用),它还实现了 R6RS 方言。

于 2012-04-28T11:45:40.077 回答
6

不,他们不相等。但是,Racket 实现可以运行标准的 Scheme 代码。方案由标准定义。球拍不是。如果你想要可移植性,你可以编写 R6RS 代码并使用 Racket 执行它。

Racket 不是 Scheme 的超集或子集。

于 2012-04-28T11:35:02.290 回答