> On Oct 21, 2017, at 10:51 AM, Konrad Hinsen <[email protected]> 
> wrote:
> 
> Matthias,
> 
>> Yes, on rare occasions, Racket programmers need to use the FFI 
>> to link in C libraries, C developers need to include ASM, and 
>> so on. But when we can, we should really stick to high-level 
>> linguistic constructs when possible and available, especially 
>> when they provide a safer way of doing things. 
> 
> At that level of abstraction in the discussion, I certainly agree.
> 
> However, macros are different because I consider syntax-parse a DSL, not
> a general purpose language like Racket, C, or ASM.
> 
> I checked my code to see what the unpleasant macros in there are doing.
> It's not the standard syntax transformation stuff, which syntax-parse
> does very well. I need to transform syntax in place but ALSO extract
> information from macros and collect them for re-using it elsewhere.
> It's not very different from what #lang scribble/lp2 does when it
> puts code blocks both in the module and in the documentation.
> 
> In my experience, syntax-parse is not very good for shuffling stuff
> around like this. It's very probably not what it was designed for
> either.


Now that’s a valid criticism. 

But, in my experience, Lisp-style macros solve these kinds of
problems in the same way that ASM solves the problem of 
grabbing control and storing it away. Sure you can do so and
nobody understands the code later and it’s brittle and error 
prone. In the context of lexical scope, this is equally true for 
Lisp-style macros. Often they don’t have the information you 
need (scope). And when you shuffle code anyways, all kinds
of subtle mistakes sneak in and when you find them, you have
no clue where they come from.

So there, this is another dissertation-level problem probably 
and I expect that building yet another DSL (or at least a layer
of macro communication) may solve it better than going back
to old-style Lisp 

— Matthias

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to