preface

 
You are your own forerunner, and the towers you have builded are but the foundation of your giant-self. And that self too shall be a foundation.
— Kahlil Gibran

Like many developers, I have grown fond of the Rust language—not per se because of the language’s great performance characteristics but because of its sound fundamentals, powerful type system, and excellent tooling. And while it may be a hard language to learn, there are a lot of guides available for getting started, including many books, tutorials, and videos. When it came to procedural macros, I felt a bit in the dark, though. Introductions and tutorials on that subject were short or partial. Peculiar, considering the vast number of libraries that were using macros for all kinds of amazing functionality!

So, after a lot of toying around with macros, I thought I could bring together what I had learned along the way, turning it into a book—a book that would take its reader on a journey from the simplest example of a procedural macro to things that could, almost, find a place in real applications. I started writing. After creating a raw draft of about a hundred pages, I contacted Manning to ask whether they were interested. They too thought that this subject was worthy of a book, and they wanted to give me a chance to write it for them. That meant more writing, the exploration of additional ideas and suggestions, and rewrites after feedback, all of which has led to the book you see before you now.