4 ms·
Having written Racket code myself I was surprised when I saw that Rust had Hygenic macros. I've never learned how to use macros effectively, but once I've gott
by Decabytes 5y ago
Having written Racket code myself I was surprised when I saw that Rust had Hygenic macros.
I've never learned how to use macros effectively, but once I've gotten more comfortable in Rust I'd like to give it a good shot. Given Dave's background with Racket and Macros, this feels like a worthwhile endeavor.
On a side note there are a lot of cool language oriented programming stuff that Racket does through it's macro system, and I wonder if it is at all possible to do something like that in Rust
- yw3410 5y agoI was super-surprised when I used rust macros (specifically macro rules) about how lispy it was. There was an aha-moment when I realised that it was token based and not AST based like some other macro systems I've worked with in some other languages. Case in point is how to express varargs in macro rules which is expressed roughly like a comma followed by an expression repeated n times. Super nice.