[racket] two languages at a time in DrRacket

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Jun 30 15:42:56 EDT 2010

This is very easy to do.

If you take a look at


You'll see that there is one parser and compiler for the module body
(this-read-syntax) and there is another for the REPL interactions
(parse-statement). In this case one is a subset of the other, but it
would be easy to have them be arbitrarily different.

Your module language would set up a way to communicate with the REPL,
which would use a special #%top-interaction macro to deal with it.


On Wed, Jun 30, 2010 at 1:08 PM, Shriram Krishnamurthi <sk at cs.brown.edu> wrote:
> Surely someone here has done something like this before, and I'd like
> advice on how to do it.
> We're in the process of converting Margrave, our security analysis
> tool, over to Racket, and to exploit DrRacket as its user environment.
> What we'd like to be able to do is this: in DrRacket,
>  Interactions Window:
>    <a CISCO IOS firewall policy>
>  Click Run to "load" this policy
>  Definitions Window:
>    <a query in our SQL-like policy query language>
> That is, just as the REPL explores the values of the program in the
> definitions window, the policy query language explores the firewall
> policy in the definitions window.
> One analogy might be that it's like writing a Java program up top, and
> using Scheme in the REPL to explore it.  But that's only an analogy as
> far as syntax goes.  Semantically, our problem is worse (in the Java
> case, one could compile the Java into Scheme, a la ProfJ; we don't
> even have such a common intermediate language; the policy compiles to
> first-order models, and the query runs against them).
> Any thoughts on how to structure such an interaction?
> Shriram
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.