Scheme style macros in Clojure: https://github.com/qbg/syntax-rules

Scott


On Sat, Dec 3, 2011 at 1:20 PM, Razvan Rotaru <razvan.rot...@gmail.com>wrote:

> Hi everyone,
>
> I was searching the web these days trying to find out more about these
> two macro systems and understand their differences, and why one is
> preferable over the other (or not). I'd like to share with you some
> ideas, and hopefully get some opinions back as well. Coming from the
> lisp side, and without much knowledge on scheme macros, I'm also
> trying to decide for myself whether scheme macros can have a
> (practical) advantage.
>
> One good point (found here http://lambdagrok.wikidot.com/forum/t-194636)
> I think explains it pretty well: lisp macros merely transform a list
> into another, while scheme macros use a pattern matching "sub-
> language" to "apply transformations" on the input syntax, and produce
> new syntax. I think this puts the finger on the spot.
>
> It seems to me that with macros, scheme breaks out of the
> homoiconicity of lisp, and opens up a new array of possibilities:
> define new languages with <b>different</b> syntax (while lisp allows
> new languages but with the same syntax). I'm saying this by looking at
> Racket and the direction it has chosen to go (have a look at Typed
> Scheme and Datalog). This looks like the world turned upside down: the
> pattern matching macro system is the essence of the system, and scheme
> is just another language defined with it. The list is not that
> important anymore, since it's not so essential for the macro system.
>
> Now, I have read some opinions which say that most who choose the
> scheme macros, make it for the pattern matching abilities and not for
> the hygienic part. This seems like a reasonable thing to do, since I
> don't hear lispers complain about unhygienicity. If there are people
> out there who had some practical experience with scheme macros, I hope
> they read this post and share some thoughts.
>
> I have a feeling that there's an additional gain with scheme macros:
> debugging information given by the system when something goes wrong.
> But it's only a feeling, I know too little of this subject to be sure.
> Macros are hard to debug. The stacktrace displayed by clojure does not
> contain information related to macro code. It's probably hard to do.
> My feeling relates to the fact that in scheme macro processing is not
> arbitrary, but rather strictly defined and under control. So I'm
> thinking that this gives scheme more control over what's going on in a
> macro and also enables scheme to give me more information in a
> stacktrace. I'd love to hear other opinions on this.
>
> Another point I find peculiar is the small attention that scheme
> macros got during all these years. I wonder why it's like that. It
> could be scheme's low score for practical stuff, but then again I
> don't know of another language that borrows these kind of macros. Does
> anybody know?
>
> And lastly, a question to Rich Hickey, should he read this post: what
> is the reasoning behind the choice of lisp macros over scheme's?
>
> Cheers,
> Razvan
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to