[plt-scheme] R6RS Interoperability

From: Tom Gordon (tom.gordon at mac.com)
Date: Wed Jun 25 13:38:46 EDT 2008

I've been looking forward to version 4.x of PLT Scheme because of its
support for R6RS.   We've begun porting a system we wrote in PLT Scheme
<http://carneades.berlios.de> to R6RS using version 4.0  We had hoped to
be able to do this at our leisure, on a module by module basis, because
as noted in the manual

 > an R6RS library can refer to modules that are implemented in other
dialects supported by PLT Scheme, and other PLT Scheme modules can refer
to libraries that are implemented in R6RS.

The manual clearly warns, however:

 > Beware that a pair in R6RS corresponds to a mutable pair in

We hadn't anticipated just how severe the consequences of this would be.
  It made it impossible to incrementally port our system, since lists in
a module ported to R6RS could no longer be used by the modules using the
PLT dialect of Scheme.

Rather than trying to patch the PLT modules to convert between lists and
mlists, we decided to set other tasks aside to port everything to R6RS.
But this opened a can of worms.  Some of the SRFIs our code depends on
could no longer be used, or rather the standard PLT Scheme ports of
these SRFIs couldn't be used.  Thankfully Derrick Eddington has ported
many of the SRFIs to R6RS:


But since there are many interdependencies between the SRFIs, it has
become clear that by the time we are finished we may need R6RS versions
of most of them.

The next hurdle is the SSAX library for processing XML.  You guessed it,
we can no longer use the PLT version on the PlaneT Package Repository.
Unfortunately, as far as we can tell no one has ported SSAX to R6RS yet,
so we may have to tackle this task ourselves.

I'm sorry this message is getting so long.  The bottom line is that it
now seems that the interoperability between R6RS libraries and PLT
modules is actually very weak.  After all, pairs and lists are pretty
pervasive in Scheme programs.

While PLT Scheme can be used as an R6RS implementation, be forewarned
that a decision to us R6RS comes with a fairly high price tag:  You will
not be able to use many, maybe most, PLT modules in your R6RS libraries
and those who prefer to write their code using the PLT dialect of Scheme
may not be able to use your R6RS library.

I realize that Version 4 is the first to support R6RS at all.  I am
grateful for this and don't want to seem to be complaining.  But are
their any plans for overcoming these interoperability problems?  Or have
I overlooked some obvious solution to this problem?

-Tom Gordon

Posted on the users mailing list.