[gambit-list] Riaxpander on Gambit

Mikael mikael.rcv at gmail.com
Mon Jul 8 08:47:43 EDT 2013


Dear Matt,

If Riaxpander is kind of undocumented, now that you know how it works,
would you feel like writing a reference documentation for it, showing the
workings of the macros and exactly the expansion algorithm, with code
references?

Currently any module system, expander or Scheme implementor who wants to
get into this has no such detailed docs to work with, would be awesome.

Best regards,
Mikael

2013/7/8 Matt Hastie <matthastie at gmail.com>

> "Does [riaxpander] give useful information for the macro developer / macro
> user?"
>
> Riaxpander has capacity to serve the error reporting needs of both macro
> developer and user roles. The integration as presented, neither: a)
> effectively utilizes gambit source location data, nor b) effectively
> utilizes riaxpander history. It is a crude tool to use in its current state.
>
> "[riaxpander] compiles macros; does this mean that [riaxpander can load] a
> module that contained syntax-rules-defined macros, it will then expand any
> code using them?"
>
> Yes, this is the 'dark meat' that I stole from the chicken / riaxpander
> integration. Riaxpander does not provide a module system. One can define a
> syntax in a .scm file, compile it, load the compiled object, and use a
> defined syntax.
>
> Regards,
> Matt.
>
> On Jul 7, 2013, at 12:36 PM, Álvaro Castro-Castilla <
> alvaro.castro.castilla at gmail.com> wrote:
>
> > Thanks for the link Matt. I think I read it a long time ago. I care
> mostly about syntax-rules, because that's what you will find more often
> when using
> > I wonder how does Riaxpander perform regarding:
> > - error reporting. Does it give useful information for the macro
> developer / macro user?
> > - you say it compiles macros; does this mean that loading a module that
> contained syntax-rules-defined macros, it will then expand any code using
> them?
> >
> > I forgot to CC the thread. This was the conversation:
> >
> >
> > > Well,
> >
> > > That's a big question!
> >
> > > I'm no expert on macro expansion, but from my reading I understand the
> following:
> >
> > > Psyntax is Dyvbig's r6rs macro expander coup d'etat. It provides the
> implementation of syntax-case for r6rs from chez scheme. Use of this
> expander effectively turns any scheme into a dialect of Chez. It is also a
> large implementation, I'm not aware of how it is implemented internally.
> >
> > > Riaxpander is a syntactic closure / explicit renaming expander that
> has support for syntax-rules by expressing syntax-rules in terms of the
> simpler expanders. It is conceptually most similar to blackhole, which is
> also a syntactic closure / explicit renaming expander that has a macro
> system and build system incorporated.
> >
> > > Alexpander is an implementation of syntax-rules in r5rs - simple.
> >
> > > If you're interested in more detail without having your mind blown
> reading source, Alex Shinn wrote an excellent comparative analysis in this
> thread:
> >
> > > https://lists.gnu.org/archive/html/chicken-users/2008-04/msg00013.html
> >
> >
> >
> >
> >
> > > > Very nice! Thanks Matt
> >
> > > > What are the main differences between this expander and Psyntax or
> Alexpander?
> >
> >
> >
> >
> >
> >         Álvaro Castro-Castilla    --    a at fourthbit.com
> >           Dedicated to the Craft of Software: Turning Ideas into Reality
> >
> >
> >
> >
> >
> > On Sat, Jul 6, 2013 at 7:16 AM, Matt Hastie <matthastie at gmail.com>
> wrote:
> > Hello Gambit People,
> >
> > I've been hacking away at riaxpander, and now have it at the point where
> it runs in native gambit. It can compile Alex Shinn's matchable library and
> run the matchable unit tests - that's the net testing thus far!
> >
> > Credit here goes to Taylor R. Campbell, for creating such a very nice
> and powerful expander. My contribution was to:
> >
> > - extract riaxpander-gambit.scm from the tmp directory on Campbell's
> website,
> > - vandalize the source to support case sensitivity (lower case all
> macrology patterns),
> > - figure out the problems that prohibit gambit compile-file from working,
> > - add some dark meat from the chicken to support loading of macros in
> compiled source, and
> > - add a cond-expand classifier that works when syntax-case appears in a
> non-evaluated feature clause.
> >
> > Line numbers and decent error messages are inoperative at this time. I
> also haven't examined which scheme flavor the macrologies define. I'm not
> certain how much gambitism is there. My personal plan is to keep hacking
> away towards r7rs and/or a module system (r7rs define-library) ... but
> these are indeed lofty goals. I am already out of my depth, deep in the
> lambdas.
> >
> > Source code is in:
> >
> > https://github.com/matthastie/riaxpander
> >
> > Kind Regards,
> > Matt Hastie.
> >
> > _______________________________________________
> > Gambit-list mailing list
> > Gambit-list at iro.umontreal.ca
> > https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
> >
>
> https://mercure.iro.umontreal.ca/pipermail/gambit-list/2013-July/006867.html
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webmail.iro.umontreal.ca/pipermail/gambit-list/attachments/20130708/b4fc4aa5/attachment.html 


More information about the Gambit-list mailing list