miniblog.
← Back to all posts
Feb 6, 2018 at 08:23
Implementing an RPN macro in Rust:
https://blog.cloudflare.com/writing-complex-macros-in-rust-reverse-polish-notation/
(includes a really useful section on robust macros that produce good error messages)
Writing complex macros in Rust: Reverse Polish Notation
Among other interesting features, Rust has a powerful macro system. Unfortunately, even after reading The Book and various tutorials, when it came to trying to implement a macro which involved processing complex lists of different elements, I still struggled to understand how it should be done.
Wilfred Hughes
Related Posts
Aug 4, 2016 at 02:38
Good error reporting in macro systems is tricky. An interesting Rust RFC to provide better messages:
rfcs/text/0000-add-error-macro.md at sg-add-error-macro · sgrif/rfcs
RFCs for changes to Rust. Contribute to sgrif/rfcs development by creating an account on GitHub.
Wilfred Hughes
Shared words: Rust, macro, good, error, messages Score: 149.3
Oct 6, 2016 at 23:24
Rust's error messages can refer to multiple parts of code, and include increasing amounts of prose:
https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html
looks promising!
Redirect
blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html
Wilfred Hughes
Shared words: Rust, includes, error, messages Score: 109.6
Jul 31, 2022 at 05:01
Rust is exploring ideas that allow it to generalise over effects, so you don't need foo and foo_async. It's an unusual name, and potentially complicates error messages, but it's good problem to examine.
Redirect
blog.rust-lang.org/inside-rust/2022/07/27/keyword-generics.html
Wilfred Hughes
Shared words: Rust, good, error, messages Score: 104