Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!uunet!mcsun!corton!ilog!davis From: davis@passy.ilog.fr (Harley Davis) Newsgroups: comp.lang.scheme Subject: Re: Making programs out of modules in Scheme Message-ID: Date: 24 Jun 91 10:54:52 GMT Article-I.D.: passy.DAVIS.91Jun24125452 References: <6384@goanna.cs.rmit.oz.au> Sender: usenet@ilog.fr Organization: ILOG S.A., Gentilly, France Lines: 50 In-reply-to: ok@goanna.cs.rmit.oz.au's message of 19 Jun 91 07:11:20 GMT In article <6384@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: I just received E-mail from someone who believes that Scheme as it currently stands does not have the facilities required to build a library out of modules. I claim that he is wrong, that Scheme as it stands provides everything we need to build programs out of modules that do not interfere with each other's name space. All it takes to do this is to define ONE globally accessible function. It's true that in Scheme, CommonLisp, or many other languages you can get a sort of poor man's module facility using conventions like those described. However, they do not support many of the features that modules are generally thought to give you: * Compile-time or load-time resolution of bindings. * Renaming on import or export. * Ease of module integration. (In all of the proposed mechanisms, referencing a local function is quite different from referencing an imported function. If this is not the case, it is impossible to hide local names.) In addition, a language which requires compile-time runtime features -- eg, macros -- should distinguish between compile-time requirements and runtime requirements, to minimize application size. A module system for such a language should support this distinction. CommonLisp does this with EVAL-WHEN, but modules with explicit compilation and runtime requirements provide a more comprehensible way. In general, extensions or conventions which provide major language features are frustrating, because implementations cannot leverage off them to increase program and programmer efficiency. This is why, for example, EuLisp and Le-Lisp version 16 provide modules as a language feature rather than as separate add-ons. However, for Scheme, a smaller language with more limited goals, the suggested approaches may make sense. Also, intermediate approaches like the "modules" of C can be useful without incurring much cost to the language implementor. -- Harley Davis -- ------------------------------------------------------------------------------ nom: Harley Davis ILOG S.A. net: davis@ilog.fr 2 Avenue Gallie'ni, BP 85 tel: (33 1) 46 63 66 66 94253 Gentilly Cedex, France