4

Looking further into Rust, the macros are quite sexy. My first reaction was "omg really"? But then I learned that macros in Rust are nothing like macros in C++.

Again, comparing with my favorite language Swift, it feels like Rust macros are somewhat similar to result builders (formerly named function builders). Or they they have a similar purpose. Both evaluate to some type safe result at compile time and are a perfect tool to make DSLs.

But Rust’s macros can do even more than that. It’s truly amazing.

Comments
  • 0
    What are you building with rust? I'm interested in getting into it after I get some more practical experience with Golang.
  • 0
    @ars1 Nothing yet. I’m just interested in language design and Rust is a particularly interesting language.
Add Comment