[gambit-list] Module system ELS20 presentation

Marc Feeley feeley at iro.umontreal.ca
Mon Apr 27 10:24:03 EDT 2020


> On Apr 27, 2020, at 9:26 AM, John Cowan <cowan at ccil.org> wrote:
> 
> Very interesting indeed!  I will look at the paper.
> 
> I'm particularly glad to see that the module system is R7RS-compatible.
> 

Well… one of the supported module systems is R7RS compatible.  There’s also a “primitive” module system that is much more Gambit specific, but has some features not found in the higher-level R7RS compatible module system.

The intent is to promote the R7RS compatible module system for typical use and the primitive module system mostly for internal use.

One of the extensions motivated by Termite was the use of library names that include the URL of the VCS repository and version, for example:

    (import (github.com/gambit hello demo @2.1))

It allows running that code with:

    gsi github.com/gambit/hello/demo at 2.1

Gambit also has “builtin” modules that are named like this:

    (import (gambit list))
    (import (_test))

It would be good if the Scheme community came to a set of rules for managing the “namespace” of library names, beyond reserving (scheme …) and (srfi …) and (<scheme-system> …).  Specifically, I think a library name starting with a URL should be automatically reserved to the person or organisation that controls that URL.  Also, a library name starting with an underscore should be reserved for the Scheme implementation, and have a meaning that depends on the Scheme implementation.

> A Termite-specific question:  why send bytecode rather than C (perhaps minified by removing whitespace)?  Presumably that would cost nothing at the source node (it's already been done) and be faster and cheaper at the destination node?  Is the bytecode so much more compact as to make transmitting C untenable?

Termite does not send bytecode.  If you are referring to the slides, we were just saying “one way to implement portable code is with bytecode” but Termite does not do that.  It can either send what is essentially an AST (in the “interpreted” code case), or a symbolic reference to the compiled code control point (in the “compiled” code case).  A symbolic reference is basically the pair <procedure_name, seq_number>.

Marc





More information about the Gambit-list mailing list