What is the best Scheme interpreter or compiler?
Solution 1
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
.
Solution 2
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).
Solution 3
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.
Solution 4
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.
Solution 5
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.
Related videos on Youtube
adhanlon
Updated on December 07, 2020Comments
-
adhanlon over 3 years
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!
-
Charles Duffy about 14 yearsBTW, 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!
-
-
Jyaan over 13 yearsChicken owns. I actually get to use it for real work, too. And don't forget about Gambit-C, either.
-
knight almost 13 yearsAFAIK mzscheme creates an statically linked executable, whereas chicken scheme's dynamically linked against libchicken.
-
alvatar over 11 yearsThat's right, try to run that 16k file in your platform without Chicken Scheme. It is dynamically linked.
-
Omar Antolín-Camarena almost 11 yearsWhat did you find unsatisfactory about Chicken Scheme?
-
day over 10 yearsWith the option
-static
, you can also get a statically-linked executable from the chicken compiler. Formzc
, a#lang scheme
declaration needs to be added at the beginning of the source. Thenmzc --exe mztest hello.scm
gives a 4.6M executable. Whilecsc hello.scm -o cktest
gives a 3.2M executable. -
Leushenko almost 10 yearsCan'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.