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 scheme, 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.
Racket is very close to Scheme, and in fact until two years ago it was called PLT Scheme.
However, the default language that is used in Racket diverges from Scheme in a few places (most notably it has immutable pairs). This is not something new: it had similar differences when it was called PLT Scheme. It's also not something that is unique to Racket: the Scheme standard(s) are so minimalistic that the language that they define is impractical, which means that all Scheme implementations add their own extensions. Another important point in the Racket case is that defining new dialects is very easy -- and Racket implements a strict R5RS dialect (the fact that it's strict means that it's not very useful) and it also implements an R6RS dialect.
No, they are not equal. However, the Racket implementation can run standard Scheme code. Scheme is defined by a standard. Racket isn't. If you want portability, you can write R6RS code and execute it using Racket.
Racket is not a superset or subset of Scheme.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With