Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: