[plt-scheme] [redex] extending languages
On Mon, Jan 4, 2010 at 9:59 AM, Keiko Nakata <keiko at kurims.kyoto-u.ac.jp> wrote:
> Hello,
>
> I am wondering what would be a recommended way to play with
> extending languages in plt redex.
>
> When a language is extended with new constructs, then I need to extend
> both the reduction-relation and associated metafunctions, such as one
> for substitution. As a reduction-relation is extended,
> rules inherited from the original reduction-relation should use
> extended metafunctions. Similarly when a metafunction g, which may call
> another metafunction f, is extended,
> clauses inherited from original should call the extended version of f.
>
> Is this doable within redex facilities?
Unfortunately, it is not, at the moment. Matthew had a nice suggestion
about how to do this and it is on the list to be added to Redex, but
it isn't there yet. Sorry.
> Or, should/could I use PLT's unit system?
I'm not sure if the unit system will actually be able to do this for
you. If you try it and it doesn't turn out to work, the usual hack is
to build some macros that expand into the language definitions you
want to extend and use them to work around Redex's shortcomings.
> [In short, I am facing the so-called expression problem.]
The correct term is the "extensibility" problem. See:
http://www.cs.utah.edu/plt/publications/icfp98-ff/
Robby