I have started writing a book about declarative language definition with the Spoofax Language Workbench. The first chapter about Getting Spoofax is done. The chapter explains how to get started for Eclipse newbies. In particular, Spoofax is now shipped as a complete Eclipse installation including JRE and the appropriate patches to the ‘eclipse.ini’ file, so that it should be easy to get started. In the next chapters I will be discussing the definition of a language using Spoofax from a user perspective.

The project is on GitHub and there’s a website with a link to latest version:


The book is a PDF in a format that is intended for reading on tablets (e.g. using the GoodReader app on iPad), i.e. big letters and no margins.

The source code of the book and of the accompanying Spoofax projects are all in the GitHub repository, so that it is easy to provide contributions, from typo fixes to entire chapters. Pull requests are welcome.

I’ll update this post with news about new chapters.

June 17, 2015: Version 0.3: Chapters on testing and syntax definition

I have added two chapters to the book. Chapter 2 gives a light introduction to testing with SPT. Chapter 3 gives an introduction to syntax definition with SDF3. The chapters use example project Language A to illustrate the material. I have added Further Reading sections to the chapters with discussions and pointers to the literature. (Version 0.3, PDF)

June 22, 2015: Version 0.4: Transformation with Stratego

I have added a chapter on transformation with the Stratego rewriting language. The chapter includes a basic introduction to Stratego covering term rewrite rules, user-defined rewriting strategies, and parameterized and conditional rewrite rules. Further sections cover string interpolation, debugging, and the connection of transformation to a Spoofax editor using ‘builder’ strategies. The further reading section provides discusses the history of Stratego and its implementation in Stratego/XT and Spoofax.

June 25, 2015: Better URL

The book website is now at http://declare-your-language.metaborg.org/