I have officially left my first comment on a rust-lang/rust issue, and it is—unsurprisingly—me taking a strongly opinionated stance on macro hygiene :)
Conversation
Nice to see Haskell people helping to make rust be the best language it can be.
1
1
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
Cool! Do you like scala's new macro system? I've heard good things about it.
1
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
I believe it supports a number of approaches, `inline`, MetaML-style staged macros with cross-stage persistence, and compile-time and runtime staging:
- docs.scala-lang.org/scala3/guides/
- docs.scala-lang.org/scala3/referen
Not sure to what extent it also supports ‘untyped’ macros like in Rust and Scheme etc. I do remember seeing a paper on doing this in the context of Scala, but I don't know if it made it into Scala 3, or whether it remains part of a third-party framework: dl.acm.org/doi/10.1145/31
1
1
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
1
Show replies


