News for hackers. Stuff that matters.
Re:MIT 6.001 Structure and Interpretation (1986) [video] by AnimalMuppet on Monday June 22, 2020 @03:44PM (#23605317)
Are Rust macros at all comparable to Lisp macros? Can you re-write the syntax of Rust with Rust macros? Or are they more like C/C++ macros?
Re:MIT 6.001 Structure and Interpretation (1986) [video] by steveklabnik on Monday June 22, 2020 @04:04PM (#23605694)
> Are Rust macros at all comparable to Lisp macros?

There are two major kinds of macros in Rust. One of them, macro_rules, is vaguely similar to Lisp macros. It was partially designed and implemented by some big Racket fans, in my understanding.

> Can you re-write the syntax of Rust with Rust macros?

Within limits.

> Or are they more like C/C++ macros?

Neither kind of Rust macros are like C or C++'s macros.