This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: kawa module experience?


Per,

My answer will be two-fold:

1. For my Kawa Scheme code, each source file is a (usually static) module,
and each module is part of a larger package. This mostly follows the Java
way of doing things. This works quite decently for my current needs and this
scales well.

2. Regarding the proposed library facility, I do not see problems with the
proposed approach per se. The only missing part (maybe I have not read the
SRFI carefully enough) is the ability to "include" source code from another
file. This could solve many problems w.r.t. interactive/incremental
development.

The usual problem with libraries is that exported bindings cannot be mutated
outside the library/module itself. This severely limits our ability to
change the definition of a function interactively. You have to modify the
library and reload it, usually loosing all state information (sometimes,
libraries are stateful), making debugging a nightmare. 

If you have an "include" directive, you can simply put the Scheme code in a
separate source file, and you use the library facility to expose your API to
other libraries and specify dependencies to other libraries. The source code
can thus be more easily loaded in the top-level environment, debugged,
modified interactively, and so on. Also, this clearly separates the
interface and the implementation of the library. Morever, you can easily
break the library in several source files and also put many library
definitions in the same source file. Everybody is happy.

I used this approach once (using MzScheme) and it worked nicely and scaled
very well too. The SISC documentation also promotes this approach.

Dominique Boucher, Ph.D.
Lead Developer
www.nuecho.com
 
 

> -----Original Message-----
> From: kawa-owner@sourceware.org 
> [mailto:kawa-owner@sourceware.org] On Behalf Of Per Bothner
> Sent: Thursday, December 01, 2005 3:17 AM
> To: kawa@sourceware.org
> Subject: kawa module experience?
> 
> The R6RS have put out SRFI-83, with a orposed "library" (i.e. module)
> facility.  See http://srfi.schemers.org/srfi-83/
> 
> In the thread starting with
> http://srfi.schemers.org/srfi-83/mail-archive/msg00002.html
> I've been arguing in favor of having a single "library"
> per "file":  Definitions of a library should be at top-level,
> as in Kawa, rather than nested inside a (library ...) form.
> 
> However, I haven't written really large Scheme source collections.
> Some of you have large collections of Scheme files, and
> presumably written as collections of Kawa modules.  Perhaps
> you have relevant experience would could share with the
> SRFI-83 list (srfi-83@srfi.schemers.org)?  What would you
> like in a module system?  What has worked for you and what is
> awkward?  How do you organize 100s of modules?
> -- 
> 	--Per Bothner
> per@bothner.com   http://per.bothner.com/
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]