chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Writing documentation for use/include/require/etc


From: felix winkelmann
Subject: Re: [Chicken-users] Writing documentation for use/include/require/etc
Date: Tue, 23 Oct 2007 11:55:20 +0200

On 10/22/07, Will Farr <address@hidden> wrote:
>
> I'm curious if you've given any thought to adopting the module
> mechanism from R6RS.  I know that you really hated the result of R6RS,
> but I don't know how you feel about the proposed module system in
> particular.  Personally, I think it eliminates nearly all the (require
> ...), (require-for-syntax ...), (use ...), (include ...), ...
> confusion.  Said confusion is, of course, replaced by a bit more
> effort on the part of the implementor to handle the "level" separation
> (run-time is level 0, syntax expansion is level 1, syntax in syntax is
> level 2, ....) and keep track of the modules to which every binding
> belongs.  In exchange for this effort, however, your users get to
> replace all the compile-time/run-time/interpret-time
> use/include/require-for-syntax stuff with (import ...).
>
> Do you have any plans for Chicken vis a vis the R6RS module system (or
> something similar)?

No, I haven't. I've tried to find a practical and useful solution to
the problem of implementing modules with support for syntax
and the only *real* solution I can think of is to implement a complete
hygienic macro system including modules. I don't think I have the
strength for this.

It appears to me that the effort to implement a module system
comparable to R6RS and integrating it into a quite large Scheme
system is immense and often underestimated.
Solving the combination of hygienic-macros and modules cleanly
is no easy task, and I know of only three systems (psyntax,
macromod and s48) that actually work. Think about it: 3, that is
not very much, considering the sea of Scheme and Lisp
implementations. There is Andre van Tonder's system, which is
very good, but not that easy to integrate into a Scheme system,
is more of academic value (even though I think it is the most
Lispish solution) to macros, syntactically.

R6RS-like modules do also not solve the problem of linking.
There are various ways of interfacing with compiled code (a
fundamental part of what chicken is and what distinguishes
it from many other Schemes - statically linked binaries, dynamically
linked binaries, dynamically loadable dynamic libraries,
mixtures of this, loading of code at compile-time (interpreted?
compiled?) and finally linking with C and C++ object code).
You will find nothing about this in the R6RS spec, and there
is no general solution that covers all situations.

There is currently a pragmatic option, though: the "modules"
egg provides psyntax compatible modules (without support
for exporting syntax). It has recently been ported to
syntactic-closures and it allows importing module info from
.exports files (the psyntax version in chicken's "syntax-case"
does the same). So it is already possible to write generic modules
as long as they do not export syntax (this has to be done in
the usual manner). I haven't tested this all yet, but it should
basically work. With some effort it might be possible to actually
export low-level macros, one day. But it will always be a hack.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]