TIL eager macro expansion can mean very different things.
Rust macros must expand to valid code, so eager macro expansion allows illegal intermediate states: https://docs.rs/eager/0.1.0/eager/macro.eager.html#macro-expansions
Elisp macros are expanded at runtime unless expansion is eager: https://dgutov.github.io/blog/2013/04/07/emacs-24-dot-3-s-killer-feature-eager-macro-expansion/
Related Posts
Claude asked me a question today: was I looking for an Emacs plugin (because I was talking about elisp) or a Rust program (because I have configured Rust preferences)?
I'm really impressed, it's rare to see LLMs ask follow-up questions.
(I wanted Emacs in this case.)
TIL Rust has an ambiguity `if Foo {}` -- is `Foo` a value of type bool, or a struct?
Rust solves this by defining a grammar production 'any expression except struct literals' and using it in this position. https://rust-lang.github.io/rfcs/0092-struct-grammar.html
It took me way too long to realise that Arc<Mutex<T>> is basically a way to create multiple &mut T references (with runtime constraints).
This means that you can use plain &T and &mut T in the vast majority of your code. Most code doesn't need to care there's a mutex.