Conversation

This is all based on my Racket experience, not Haskell! Haskell doesn’t have hygienic macros (and really I don’t believe it has macros at all).
2
8
tbh, I’ve gotten this question a number of times over the past ~6 years, and every time I’m unsure whether they’re referring to some new macro system I’m as-yet-unaware of or if it’s the one I know about, as they’ve gone through several already. do you have a documentation link?
1
2
Yes, I would not really call any of these things a “macro system”, personally. They are much closer to staging systems or Template Haskell than Lisp/Rust macros. The problem with all these systems is that they only allow quotation of fixed syntactic classes, like exprs/types.
2
1
The whole *concept* behind a macro system, in my mind, is that it allows you to extend those syntactic classes. Both Lisp and Rust make this possible by only parsing a minimal tree structure that provides grouping, then letting macro code do the actual *parsing*.
1
5
This is why the R in REPL is “read”, not “parse”. Reading an s-expression does not parse a Lisp program in any sense—it just gives you its grouping structure. The mechanism by which you parse a Lisp program is macroexpansion. Each form in the language is associated with a parser.
3
8
Giving the programmer `quote` and `splice` operators is interesting, but it doesn’t really let you do virtually any of the things people write Racket macros to do, because those macros have their own grammar and scoping rules. So I think calling these “macros” is just confusing.
1
4