apdopa6 0 #1 Опубликовано 3 часа назад Today I had an interesting realization that macros in Rust almost feel like a small language inside the language itself. They have their own rules, syntax, and behavior that is not exactly like normal Rust code. At first, this made them feel confusing and disconnected from everything else I was learning. But now I see that this is what makes them so powerful. They allow you to define patterns that behave like custom commands. Instead of writing repetitive logic, you define how code should be generated. This feels very different from traditional programming. I also noticed that this is why macros require a different way of thinking. You are not just writing instructions for execution, you are writing instructions for code generation. That is a big shift in mindset. It also explains why macros are used heavily in frameworks and libraries. They allow developers to build more expressive tools. Even though I still find them complex, I can see the purpose behind their design. I feel like understanding macros is not just about learning syntax, but about learning a new way of thinking inside Rust itself. 0 Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты