Hello Racketeers, TLDR: I want to implement [1] using Redex.
I hope somebody can shed some light on my problem. I'm trying to use Redex (which looks super cool, but i'm having trouble wrapping my head around all of it), and i'm a little stuck (i've tried RTFM, but i'm a little lost anyway). I wonder if what i'm trying to do is reasonable/feasible. I have a system which works, which i want to "reimplement" using Redex. My system (already in Racket) does the following: it provides a declaration language (just a set of keywords which aren't particularly relevant to the problem) which can be used to specify separate components expected in an application. It provides keywords like #lang myspeclang (define-component SomeName Int) ; declare a component This file should then be referred to by the "implementation module", so if the above is written in a file called specs.rkt, i provide a mechanism to write the following sort of terms: #lang "specs.rkt" (implement-SomeName (lambda () .....)) ; provide SomeName's implementation This is done by various macro tricks (nothing groundbreaking) -- i provide macros like the implement-SomeName above, depending on the declarations provided. Anyway, i am beginning to wonder if this type of thing can be expressed in Redex? I have a Redex model which specifies the grammar of my declarations, which i use to evaluate the declarations (thanks to David van Horn's approach [0]). I can see this working, but ultimately i'm not actually interested in a reduction relation per se: the declarations are already "reduced" and i'm interested in them only for their side-effects, e.g. defining a macro called "implement-SomeName" when a declaration for SomeName is encountered. I've been toying with this idea, and i'm worried i'd have to model (minimal) Racket itself in Redex to be able to express what these declarations should reduce to, but that (intuitively) sounds like the Wrong Way™ to go about things. My other idea was to add a "skip" terminal to the declaration language which everything reduces to, but as a side-effect running a bunch of code to define the needed macros. This also sounds Ugly©, though. Basically, my reduction goes from the domain of my declarations to the domain of macros or modules, and not, like in the schoolbook λ-calculus examples, from terms to terms in one language. Does anyone have a pointer towards something similar? Or insight into which Redex technique might be appropriate? Or a simple two-line email saying it's impossible? :p I have the PLT Redex book, but haven't got the impression my case fits well into one of the many examples. I would be happy to be told otherwise though. I'm sorry for the long-winded email, which probably still leaves details unclear. Don't hesitate to prod me for more details. There is a write-up of this exact system at [1], but it's perhaps a bit long for casual potential helpers to look at. Kind regards, p. 0. <https://groups.google.com/forum/#!searchin/racket-users/redex/racket-users/lKg-77Wh8M0/ULAxOHtENCQJ> 1. <http://people.bordeaux.inria.fr/pwalt/docs/decls.pdf> -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.