2. Bigloo
A practical Scheme compiler (4.3g)
User manual for version 4.3g
December 2019 -- Overview of Bigloo
Bigloo is an implementation of an extended version of the Scheme programming language. Without its extensions Bigloo does not entirely conform to Scheme as defined in the Revised(5) Report on on the Algorithmic Language Scheme (henceforth R5RS) (see info-file `r5rs.info', ). The two reasons are:

  • Bigloo produces C files. C code uses the C stack, so some programs can't be properly tail recursive. Nevertheless all simple tail recursions are compiled without stack consumption.

  • Alternatively, Bigloo may produce JVM (Java Virtual Machine byte code) class files. These classes may use regular Java classes.

  • Bigloo is a module compiler. It compiles modules into `.o', `.class', or `.obj' files that must be linked together to produce stand alone executable programs, JVM jar files, or .NET programs.
However, we designed Bigloo to be as close as possible to the R5RS. Hence, when Bigloo includes a feature that is extracted from Scheme and implemented as normal, this feature is only mentioned in this document and not fully described.

2.1 SRFI

The Bigloo version 4.3g supports the following SRFIs:

  • srfi-0 (conditional execution).
  • srfi-2 (AND-LET*: an AND with local bindings, a guarded LET* special form).
  • srfi-6 (Basic String Ports).
  • srfi-8 (Binding to multiple values).
  • srfi-9 (Records specification).
  • srfi-18 (Multithreading support).
  • srfi-22 (script interpreter invocation).
  • srfi-28 (Basic Format Strings).
  • srfi-30 (Multi-line comments).

2.2 Separate compilation

To allow and stimulate separate compilation, Bigloo compiles modules instead of entire programs. A module is composed of a module declaration and a module body, where a module body can be thought of as an incomplete Scheme program.

Bigloo strictly enforces variable bindings. That is, it is illegal in a body to refer to unbound variables.

In a module declaration, some variables can be declared to be immutable functions. For such variables, the compiler can then check if the number of arguments for some function calls are correct or not. When an arity mismatch is detected, Bigloo signals an error and aborts the compilation process.

2.3 C interface

The goal of the design of Bigloo is to allow the merging of high and low level programming. This means that Bigloo is designed to be fully connected to the already existing outside world of C.

This connection has two components: a function call interface and a data storage interface. Bigloo code is able to call C code and vice versa; Bigloo data storage is accessible from C and vice versa. There are no frontiers between the Bigloo and C worlds. See C Interface for details.

2.4 Java interface

Since release 2.3, Bigloo is able to produce Java Virtual Machine byte codes in addition to C code. By producing class files, it is possible to connect Scheme code and Java code in the same spirit as the Scheme and C connection.

This connection has two components: a function call interface and a data storage interface. Bigloo code is able to call Java code and vice versa; Bigloo data storage is accessible from Java and vice versa. There are no frontiers between the Bigloo and Java worlds. See Java Interface for extra details.

2.5 Object language

Since release 1.9, Bigloo has included an object system. This system belongs to the Clos [Bobrow et al. 88] object system family but whose design has been mainly inspired by C. Queinnec's Meroon [Queinnec93]. It is based on ad-hoc polymorphism (generic functions and methods), uses single inheritance and mono-dispatch, and provides the user with introspection facilities.

2.6 Threads

Since release 2.4d, Bigloo has included a thread library. Bigloo supports Fair threads that are cooperative threads run by a fair scheduler which gives them equal access to the processor. Fair threads can communicate using broadcast events and their semantics does not depends on the executing platform. Fine control over fair threads execution is possible allowing the programming of specific user-defined scheduling strategies.

2.7 SQL

Since release 2.7b, Bigloo includes a SQL binding. Namely, the C Bigloo runtime system can access the facilities offered by SQLite (http://www.sqlite.org/).

2.8 Type annotations

Type information, related to variable or function definitions, can be added to the source code. If no type information is provided, runtime checks will be introduced by the compiler to ensure normal execution, provided that the user has not used compilation flags to prevents this. If type information is added, the compiler statically type checks the program and refuses ones that prove to be incorrect.

2.9 Unicode support

Bigloo supports UCS-2 Character encoding and also provides conversion functions between UTF-8 and UCS-2. It still maintains traditional ISO-LATIN1 characters and strings.

2.10 DSSSL

Bigloo helps the DSSSL programmer by supporting keywords, named constants and keyword functions.

This Html page has been produced by Skribe.
Last update Mon Dec 9 13:24:30 2019.