home texts sources

Scheme on FreeBSD notes

Author: Yegor Samusev <yegor@samusev.pp.ru>
Modified:2010-12-26

Contents

Implementations of Scheme

There are a lot of implementations of Scheme. Some of them:

Implementation URL Standards Platform Programs Port
IEEE 1178-1990 R4RS R5RS R6RS ERR5RS Compiler Interpreter
Chicken http://call-cc.org/     +       chicken csi lang/chicken
Gambit http://dynamo.iro.umontreal.ca/~gambit/ + + +       gsc-gambit gsi-gambit lang/gambit-c
Gauche http://practical-scheme.net/gauche/index.html     +         gosh lang/gauche
Guile http://www.gnu.org/software/guile/     +         guile lang/guile
Ikarus Scheme http://ikarus-scheme.org/       +   i386 ? ? lang/ikarus
MIT/GNU Scheme http://www.gnu.org/software/mit-scheme/ ? ? +     i386   scheme lang/mit-scheme
Mosh http://code.google.com/p/mosh-scheme/       +   i386 ? ? lang/mosh
Ypsilon http://code.google.com/p/ypsilon/       +       ypsilon lang/ypsilon

There is also Racket (formerly known as PLT Scheme) in the ports tree (lang/racket) but it is more than just a Scheme implementation.

Chicken

Chicken has eggs en (Chicken-specific extension libraries)! All eggs are stored in a repository. By default the current repository is /usr/local/lib/chicken/5 but I'm sure that you don't want to install new eggs under root (and maybe you don't have permissions) in that place. You can set a new place:

%mkdir -p $HOME/.chicken
%chicken-install -i $HOME/.chicken
%setenv CHICKEN_REPOSITORY $HOME/.chicken
%setenv CHICKEN_INSTALL_PREFIX $HOME/.chicken
%setenv CHICKEN_INCLUDE_PATH $HOME/.chicken/share/chicken

That's all! Now you can easily install eggs by typing:

%chicken-install egg

Please note:

  • Platform-dependent binaries (shared libraries or *.so) are stored in CHICKEN_REPOSITORY.
  • Platform-independent sources (*.scm) are stored in CHICKEN_INSTALL_PREFIX/share/chicken.

Now you can load an egg:

(require-extension binary)

; or

(include "source")

Don't forget to set variables in your rc file!

.csirc

By default the interpreter (csi) doesn't provide line-editing but you can install linenoise en or readline en and then activate it:

(use linenoise)
(current-input-port (make-linenoise-port))

Guile

.guile

By default Guile doesn't provide the readline but you can activate it:

(use-modules (ice-9 readline))
(activate-readline)