Hey everyone, I want to start using Scheme and I have two questions. First, would you recommend using an interpreter or a compiler for Scheme and why? Second, which interpreter or compiler for Scheme would you recommend and why? Thanks!
-
My question was a little different then those, but thanks! – adhanlon Mar 26 '10 at 20:31
-
2BTW, as a "what is the best" question without clarifying details, this one seems awfully subjective. If there was agreement on a single best scheme implementations (for all purposes and use cases), we'd only have one! – Charles Duffy Mar 27 '10 at 16:36
-
Definitely a constructive question, people with more rep than me should re-open this – ylun.ca Nov 14 '14 at 08:11
5 Answers
For a beginner, I would highly recommend DrRacket (formerly Dr. Scheme), since it gives you a really nice environment to work in, supports many dialects of Scheme, and gives very good failure and debugging information. I believe most implementations of Scheme are interpreters, although it is possible that there is a compiler out there.
If you are a commandline junkie like me, an alternative you might consider is to run the racket interpreter directly, which is essentially the same thing as Dr. Racket, but without the graphical environment and a commandline interface. Or, start your source file with #! /usr/bin/env racket
and make it executable with chmod +x source.rkt
.

- 2,031
- 1
- 26
- 28

- 93,612
- 16
- 138
- 200
-
3Dr. Scheme is one of the most complete interpreters I have used. Very useful for beginners who get stuck at the command line and cannot translate the cryptic error messages into where the code is wrong. – eric.christensen Mar 26 '10 at 06:41
-
5Actually there more big-name Scheme compilers than interpreters: ikarus, chez (the non-free version), gambit, chicken, bigloo. In fact mzscheme/DrScheme is JITted in current versions. See http://en.wikipedia.org/wiki/Category:Scheme_compilers – Nathan Shively-Sanders Mar 26 '10 at 13:54
-
I am a command-line junkie too, I have been using Dr. Scheme a bit, but I will give mzscheme a try too. I've also been using gambit-c a little too, any thoughts on that? – adhanlon Mar 26 '10 at 15:47
I know you already accepted the answer, but for future visitors to this question, I recommend Chicken Scheme. It tends to produce much smaller executables than mzscheme does. Take the following hello world application, for instance:
(define (say-hello name)
(print (string-append "Hello, " name))
(newline))
(say-hello "Earthling")
Compiled with mzc --exec mztest hello.scm: 3.3M
Compiled with csc hello.scm -o ctest: 16k
And if you're after library support, Chicken provides Eggs Unlimited, which is like PlaneT for mzscheme (or gems for ruby).

- 11,733
- 9
- 70
- 131

- 3,928
- 22
- 21
-
4Chicken owns. I actually get to use it for real work, too. And don't forget about Gambit-C, either. – Jyaan Oct 22 '10 at 05:42
-
16AFAIK mzscheme creates an statically linked executable, whereas chicken scheme's dynamically linked against libchicken. – Rui Vieira May 21 '11 at 10:10
-
7That's right, try to run that 16k file in your platform without Chicken Scheme. It is dynamically linked. – alvatar Dec 14 '12 at 14:32
-
9With the option `-static`, you can also get a statically-linked executable from the chicken compiler. For `mzc`, a `#lang scheme` declaration needs to be added at the beginning of the source. Then `mzc --exe mztest hello.scm` gives a 4.6M executable. While `csc hello.scm -o cktest` gives a 3.2M executable. – day Jan 13 '14 at 06:28
-
I use to love chicken schem but lately a lot of my software keeps breaking and i dont like that. I Would really say stick to racket. Stuff doesnt break when they move. – pankajdoharey Aug 01 '19 at 12:13
I'd recommend Gambit-C scheme:
- It's R5RS-conformant.
- It has both an interpreter and a compiler. You can also compile to ANSI C.
- It's open source.
- It's portable. (It runs on Linux, Windows, Mac OS X and even iOS.)
- It has simple foreign function interfaces (FFI).
A cursory examination reveals that Chicken seems unsatisfactory, while Bigloo may be a serious contender. But I cannot comment too much about them.
-
5
-
3Can't answer for the OP, but in the small number of (as always, completely meaningless) benchmarks I tried when choosing which one to use recently, Gambit absolutely owned Chicken for performance. It seemed like Gambit was better than twice as fast on average. Chicken's GC was also a *lot* slower, like ten times or something. – Alex Celeste Jul 07 '14 at 03:15
I'd recommend not being concerned about whether it's implemented as a compiler, interpreter, or combination thereof -- especially to start with, the quality of help files (for one example) will matter far more than exactly how it's implemented.
As far as which one, DrRacket is what I use (by far) the most often.

- 476,176
- 80
- 629
- 1,111
PTL Scheme has been renamed to Racket (http://racket-lang.org/), but it's still pretty much the same. Dr. Racket is a very nifty development environment with a shell, and to write in Scheme all you need is #lang scheme
at the top of your file.

- 14,014
- 8
- 55
- 80