<div dir="ltr">Marc,<div><br></div><div>I assume there is 1:1 correspondence between a prospective (preload-module foo) and a "x/y/z/foo.scm".</div><div><br></div><div>Do you have a plan for how you intend to map the preload-module identifier symbols to their corresponding pathed file name strings?</div>
<div><br></div><div>I foresee that <i>preload-module</i> can provide a syntax that is isomorphic to the chez scheme <i>visit,</i> and it can thus provide better syntax-case integration. With preload-module, sources may be able to specify a dependency on compiled syntax across gambit modules, using a syntax that is native to gambit.</div>
<div><br></div><div>It is also great to see module loading order removed from the ordering of objects on the gsc command-line, which if I'm not mistaken is how it is done today.</div><div><br></div><div>Does the existing gsc command-line functionality continue to provide an implicit module load order in cases where the new syntax is not present?</div>
<div><br></div><div>Is there a reasonable behavior in the absence of <i>preload-module </i>syntax, or use cases where <i>preload-module</i> is partially provided by a subset of sources<i>?</i></div><div><br></div><div>Do you anticipate modules with symmetric or symmetric transitive dependence? In such a use case, I'd presume load order is irrelevant providing that linkage is complete, but the issue of ordering top-level initialization may remain. This could be problematic for a proposed syntax case usage, as it is easy to specify symmetrically dependent compiled syntax between two files: if cyclic <i>preload-module</i> is not permitted, then syntax-case presumably needs a separate syntax to specify syntax dependency between files, if symmetrically imported syntax is a warranted feature.</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Nov 6, 2013 at 7:45 AM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On Nov 6, 2013, at 3:03 AM, Álvaro Castro-Castilla <<a href="mailto:alvaro.castro.castilla@gmail.com">alvaro.castro.castilla@gmail.com</a>> wrote:<br>
<br>
> It would be like a module system without the namespaces.<br>
<br>
</div>Yes, that's a way to put it.<br>
<br>
Note that my proposal only aims to provide a very basic mechanism for loading in a VM modules of code with their dependencies. The "depends-on" form could of course be used for building a (slightly) higher-level module system to ensuring that module dependencies are satisfied.  By the way, I think this form is probably best called preload-module, so that a program could be written like this:<br>

<br>
(define (f n)<br>
  (preload-module math)<br>
  (+ (math:cbrt n) (math:fact n)))<br>
<br>
(define (g x)<br>
  (preload-module postscript)<br>
  (preload-module math)<br>
  (postscript:circle (math:square x)))<br>
<br>
The code would be roughly equivalent to:<br>
<br>
(if (not (loaded? 'math)) (load 'math))<br>
(if (not (loaded? 'postscript)) (load 'postscript))<br>
<br>
(define (f n)<br>
  (+ (math:cbrt n) (math:fact n)))<br>
<br>
(define (g x)<br>
  (postscript:circle (math:square x)))<br>
<br>
In other words, the requests to preload modules are just annotations that are accumulated for the whole module.  The set of requests causes these modules to be loaded at the very beginning of the module's execution.<br>

<div class="im"><br>
> I think that this is a very nice step, because it's an important part of the functionality of Blackhole or Schemespheres, but with the new features that you can implement at a lower level.<br>
> I'd actually like that this goes one step further an build a minimal module system (even if just select which variables to export per module). Such a simple module system (export / depends-on) would be very helpful for developing bigger applications with Gambit.<br>

<br>
</div>I agree that a lightweight module system would be nice.  This should be fairly simple to do once the linker is modified to support preload-module.<br>
<div class="HOEnZb"><div class="h5"><br>
Marc<br>
<br>
_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</div></div></blockquote></div><br></div>