Next: binfmt loading, Up: binfmt [Index]
The common way of running a Scheme script, is to invoke the executable
vicare
using the option --r6rs-script to select the
pathname of the file:
vicare --r6rs-script path/to/script.sps
to run a compiled Scheme program, we invoke the executable
vicare
using the option --binary-program to select
the pathname of the file:
vicare --binary-program path/to/program
The features implemented in the binfmt_misc
kernel module allow
us to invoke almost every program by simply typing its name in the
shell, without explicitly invoking the executable program implementing
the interpreter; this includes for example compiled Java, Python or
Emacs programs, and of course Scheme programs; this mechanism is a
generalisation of the mechanism that runs shell scripts whose file
begins with #!/bin/sh
.
With proper configuration: the kernel recognises the binary file type by matching some bytes at the beginning of the file with a magic byte sequence (masking out specified bits) we have supplied; it can also recognise a filename extension.
If we enable Vicare support for binfmt_misc
, we can run
Scheme programs as follows:
;;;!vicare
, then we just do:
path/to/script.sps
path/to/program