[Snow-users-list] Package model suggestion

Nikita Sidorov nikita1024 at gmail.com
Fri Dec 21 11:17:33 EST 2007

Hi all,

Scheme is a language of my choice and for me, as probably for many other
scheme users, sharing code between different scheme systems is a concern. It
is really important to have a platform like Snow where users of all major
implementations could effectively collaborate. But it seems to me that Snow
has unnecessary limitation of reliyng on portable code only (please, correct
me if I'm wrong). It means that a package cannot use a functionality that is
not available as a snow package even when the functionality is implemented
by most of scheme systems. SRFI-69 (hashtables) is a good example. I think
the problem is in the package model. In the current model a package provides
only one feature that is the name of the package itself. It also implies
that a certain functionality may have only one implementation - a portable

I'd like to suggest a bit different package model that is alike those used
in package managers of linux distributions (rpm,deb). In this model a
package may provide several features and several implementations of the same
api are possible. In addition, every snow system will have a preinstalled
package that provides an implementation-specific feature. For mzscheme it
will look something like this:
(package* snow-mzscheme
(provides mzscheme))
For sisc:
(package* snow-sisc
(provides sisc))

Having such model we can use implementations of apis specific to scheme
system. Let's consider an example with srfi-69.
In mzscheme srfi-69 is loaded by this:
(require (lib "69.ss" "srfi"))

In SISC it is done in this way:
(require-library 'sisc/libs/srfi/srfi-69)
(import srfi-69)

Respective implementation-specific packages will look like this:

srfi-69-mzscheme.scm :
(package* srfi-69-mzscheme
  (provides srfi-69)
  (requires mzscheme))
(require (lib "69.ss" "srfi"))

srfi-69-sisc.scm :
(package* srfi-69-sisc
  (provides srfi-69)
  (requires sisc))
(require-library 'sisc/libs/srfi/srfi-69)
(import srfi-69)

Similar packages are created for other systems that support srfi-69. Having
this done we can create a package that uses srfi-69 and runs on all the
platforms that provide it:

(package* my-package
  (requires srfi-69))

(define table (make-hash-table))

What do you think about this model?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webmail.iro.umontreal.ca/pipermail/snow-users-list/attachments/20071221/ad6d3f6c/attachment.html 

More information about the Snow-users-list mailing list