News for hackers. Stuff that matters.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by navaati on Thursday February 01, 2018 @07:35AM (#16281399)
Well C macros work at the text-level, Rust macros run at the AST level (but not the type level, that is you cannot construct syntactically incorrect stuff but you can construct wrong-typed stuff).

So I don't really know lisp macros but I guess it's still closer than to C.

Re:Writing Complex Macros in Rust: Reverse Polish Notation by foldr on Thursday February 01, 2018 @07:48AM (#16281469)
Rust macros actually work more at the token level than at the AST level.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by RReverser on Thursday February 01, 2018 @08:00AM (#16281531)
They work on both - for example, if you specify $expr:expr, it will actually parse it as an expression node and won't allow to simply pass it into another macro as $pat:pat because of AST node type mismatch even if actual tokens are still compatible.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by foldr on Thursday February 01, 2018 @08:34AM (#16281713)
That's a good point. What I was trying to get at is that Rust macros don't let you manipulate ASTs in any straightforward way. So they are not best thought of as AST -> AST transforms.
Re:Writing Complex Macros in Rust: Reverse Polish Notation by navaati on Thursday February 01, 2018 @07:58AM (#16281521)
Oh I see, thx !
Re:Writing Complex Macros in Rust: Reverse Polish Notation by kibwen on Thursday February 01, 2018 @01:14PM (#16284170)
Rust macros are Scheme macros, there's no similarity to C.