Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Scheme and Racket different? If so, how?

Tags:

scheme

racket

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.

like image 960
Aslan986 Avatar asked Apr 28 '12 11:04

Aslan986


2 Answers

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.

like image 180
Eli Barzilay Avatar answered Oct 13 '22 04:10

Eli Barzilay


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.

like image 35
Janus Troelsen Avatar answered Oct 13 '22 04:10

Janus Troelsen