You may recall how I attempted to do something along these lines a long time ago (comment: http://www.arclanguage.org/item?id=11529). The part I got stuck on was using macros in the definitions (not expansions) of macros, or in the definitions of functions I intended to use at compile time; so, for example, if I wanted to define the macro "xloop" to implement the function "tuples" and use "tuples" to implement an "=" macro, then that would not work. (My comment gives a similar example with "my-if".)
At a glance, I'm not sure whether your approach offers any hope of getting around this difficulty. Does it?
Yes. (That's what I meant by "the helper functions can be defined with a plain 'define' instead having to use 'define-for-syntax'")
But it then doesn't work with modules for the same reason. So it's not a solution yet, it just pushes around what doesn't work from one place to another.
Hmm, we should think about whether we'd want to use Racket modules anyway. Racket macros are more expressive (albeit harder to write) than Arc macros because they operate on syntax objects. But Racket modules don't seem very expressive to me: they aren't first class objects and they aren't parameterizable.
I'm guessing that a module system in the spirit of Arc would correspond more to Racket namespaces. Maybe I ought to be able to say something like:
(module arc
(load "foo.arc")
(bar))
which creates a new namespace, populates it with values from the arc namespace, evaluates the expressions within that namespace, and returns the namespace. Or something like that.