Vicare is a native compiler producing single threaded programs running on Intel x86 processors, both 32-bit and 64-bit. It officially supports the GNU+Linux platform; it should work on POSIX platforms, but not Cygwin. It offers arbitrary precision integers through GMP; it implements an optionally included foreign-functions interface based on Libffi. It is to be considered alpha quality; the project is hosted at Github and as backup at Bitbucket.
Scheme is a statically scoped and properly tail-recursive dialect of the Lisp programming language, invented by Guy Lewis Steele Jr. and Gerald Jay Sussman. It was designed to have an exceptionally clear and simple semantics and few different ways to form expressions.
The Revised6 Report on the Algorithmic Language Scheme (R6RS) gives a defining description of the programming language Scheme. The report is the work of many people in the course of many years; revision 6 was edited by Michael Sperber, R. Kent Dybvig, Matthew Flatt and Anton Van Straaten.
Ikarus Scheme was an almost R6RS compliant implementation of the Scheme programming language; it is the creation of Abdulaziz Ghuloum, which retired from deveoping it in early 2010.
Vicare (pronounced the etruscan way) is an R6RS compliant fork of Ikarus; it implements a native compiler producing single threaded programs running on Intel x86 32-bit and 64-bit processors; it officially supports the GNU+Linux platform, it should run on posix platforms.
Arbitrary precision integers are implemented on top of GMP. The foreign-functions interface (FFI) allows use of foreign C language libraries; it is built on top of Libffi. It is possible to write C language shared libraries using an internal Vicare API and interface them at the Scheme level, without using the FFI. A very basic interface to GNU Readline or compatible library is available to make life easier at the REPL; for full line-editing capabilities we should rely on rlwrap, as explained in the documentation.
A collection of libraries comes bundled with the distribution of Vicare, implementing:
Direct access to fast, unsafe, low-level Vicare operations.
Bindings to native POSIX functions.
A simple event loop library built on top of the POSIX function select().
Bindings to some GNU C library specific functions.
Bindings to some Linux specific functions.
The Scheme language
(nausicaa), written on top of the language
(vicare), providing Object-Oriented Perfumed Programming.
Other miscellaneous features.
Vicare Scheme is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
Vicare Scheme is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the Vicare Scheme package. If not, see http://www.gnu.org/licenses/.
The package release archives (tarballs) can be downloaded from the download pages at Bitbucket. End users should stick to official releases. GNU+Linux is the only officially supported platform; however it should be possible to run Vicare on POSIX systems.
The development revisions can be downloaded directly from the GitHub project page. Starting from February 2015, the use of branches is reorganised: the master branch is the development branch. To always run the latest, courageous users should track the master branch; there is no guarantee that checkouts from the master branch will work correctly.
How it works
Vicare is a compiler for the Scheme language. It does not produce standalone executable programs, neither shared libraries as C language compilers do. Source code for Vicare is either: a program, a library, an include file.
Starting with version 0.4, programs can be compiled or executed directly as scripts from source code; however standalone executable cannot be created. When running from source: it is always possible to put all the code of an application into a library and reduce the program needed to launch the application to 2 or 3 lines of Scheme code.
Vicare compiles Scheme libraries into FASL files (FASt Loading) which can be installed no the system. It also allows loading libraries in source format; in this case the code is compiled on the fly.
To run an application written in Vicare Scheme we need both the vicare executable program and the boot image file vicare.boot. The boot image contains the language implementation, the compiler and a collection of functions extending the R6RS language; it is the equivalent of what the C standard library is for the C language. To run a program file demo.sps containing the UTF-8 text:
(import (rnrs (6))) (display "Hello World!\n") (flush-output-port (current-output-port))
we can do:
$ vicare demo.sps
When running on GNU+Linux systems, it is possible to use the features of the binfmt_misc kernel module to automatically launch Vicare programs without prepending the vicare executable to the name of the program file (not a big improvement... but it is possible).
Starting with revision series 0.4 we can compile the demo program with:
$ vicare -o demo -c demo.sps
and using the binfmt_misc facilities run it with:
which will print Hello World!.
The R6 Scheme language is fully implemented; code using the compound library (rnrs (6)), or its component libraries, should run fine under all the releases from version 0.3 onwards. Development has entered revision series 0.4 which will bring many backwards incompatibilities in code using the library (vicare) and, in general, in the library infrastructure and the interface of the run-time executable program.
The code base can be partitioned in:
Executable run-time support program written in C (garbage collector, boot image loader, etc).
Scheme code implementing the assembler and the compiler.
Scheme libraries implementing the language.
Multilayer interface to the operative system services.
the current development goal is to put the code in such a shape that: the run-time support program and the language implementation will not change anymore and are just subject to maintenance (mostly bug fixes); only the assembler, compiler, interface to the OS and external libraries should see further significant work.
Bindings to foreign libraries
CRE2 Starting from version 0.2d6, Vicare comes with a binding to the CRE2 library embedded in the distribution; CRE2 is a C wrapper for RE2, a regular expressions library written in C++. Inclusion of this binding is optional, we can build and install Vicare without it.
Vicare/Expat A binding to the Expat library, a parser for XML. This is a separate package installing a C library with low-level function wrappers and a Scheme library with a higher-level interface.
Vicare/CityHash A binding to the CityHash C++ library implementing hash functions for strings. This is a separate package installing a C library with low-level function wrappers and a Scheme library with a higher-level interface.
Vicare/Template A template package showing how to write a Vicare extension using both the C language and the Scheme language. The package makes use of the GNU Autotools.
Other libraries for R6RS implementations
Industria (Github) a collection of miscellaneous libraries, especially about cryptography. There is a fork of it that repackages the distribution with the GNU Autotools and has verified support for Vicare Scheme: look for the branch vicare-scheme.
SRFI-R6RS, a port of the SRFI libraries to R6RS implementations. Notice the Vicare Scheme distribution already comes with such SRFI libraries.
Xitomatl, a collection of miscellaneous libraries. There is no support for Vicare Scheme.
PFDS, a collection of libraries implementing purely functional data structures in Scheme. There is a fork of it that repackages the distribution with the GNU Autotools and has verified support for Vicare Scheme: look for the branch vicare-scheme.
Fectors, a collection of libraries implementing functional vectors in Scheme. There is a fork of it that repackages the distribution with the GNU Autotools and has verified support for Vicare Scheme: look for the branch vicare-scheme.
r6rs-protobuf, a collection of libraries implementing the Protocol Buffer in Scheme.