[racket] Redex question: parameterizing a language definition

From: Lindsey Kuper (lkuper at cs.indiana.edu)
Date: Thu Apr 4 18:32:39 EDT 2013

On Thu, Apr 4, 2013 at 11:15 AM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
>
> Lindsey, in your case, I believe the 'rabbit hole' can be avoided.
>
> From what I understand each family in lambdaLVar is (almost) uniformly
> generated from a grammar 'functor' that receives a lattice (let's say
> one for now), computes some grammatical clauses -- and may add some
> primitive operations for working on the lattice, which is trivial --
> and returns that grammar.

Yes, that sounds very much like what I want to do.  Will this sort of
thing be possible in a future-Redex-with-modules?

> The reduction relation itself does not depend on the generated grammar
> other than the notion of value you need for beta-v.
>
> So, I think that you could use _Racket_'s syntax system to compute
> the grammar. This is quite different from extending a base grammar
> with new features or value clauses but as I said at the beginning,
> it is closer to the way you describe lambdaLVar.

So, in other words, have a macro that generates a Redex grammar?  I
can give that a try.  I did think that might be what I would end up
doing, but wanted to see first if I could get the results I wanted
without leaving Redex (and extending a base grammar was a kind of
hacky attempt to stay within Redex).

Thanks,
Lindsey

Posted on the users mailing list.