4 min read

Lorenzo Bettini is an Assistant Professor in Computer Science at the Department of Informatics at the University of Turin, Italy, and the author of Implementing Domain-Specific Languages with Xtext and Xtend. You can learn more about Lorenzo here and here.

You can also find him on Twitter: @lorenzo_bettini

We spoke to him about his book and his experience of writing it, and found out a little more about his research and daily work…

How will readers benefit from this book? Did you learn anything new while writing the book?

At the time I started writing the book (and also currently) there was no other book on Xtext (at least in English). For this reason I hope that new users of Xtext can benefit from it: following it chapter by chapter they should be able to get acquainted with this cool and powerful framework. My intention was also to describe my own experiences with Xtext (I’ve been using it for several years, since version 0.7), in particular I tried to describe some programming techniques and best practices. My two favorite chapters are the one on Testing (Testing your software is truly crucial, and DSLs implemented in Xtext are definitely no exception; the whole book is based on tests) and the one on Scoping (Scoping is one of the most difficult concepts in Xtext, but it is also one of the most important; I hope I managed to describe scoping so that it is easier for readers to understand). For these reasons, I hope that also readers who are already familiar with Xtext can learn something new.

Our authors usually have full-time jobs whilst writing for us. Was this the case for you and how did you manage your time?

I am a full-time Assistant Professor (Researcher) in Computer Science; this might sound like I have lot of spare time but that’s not the case: we too have lots of deadlines… However, since I’ve always used Xtext for implementing the languages I’m doing research on, the time I spent on the book has been a real scientific investment for me.

During the writing process, did you come across any issues/ difficulties that affected your writing and how did you overcome these?

Especially for the more advanced chapters I was kind of blocked at least on some example implementation. The authors of the Xtext framework were really available and they helped me solving such issues (not to mention that two of them, Jan Koehnlein and Sebastian Zarnekow, also reviewed the book). I’m really grateful to all of them (especially for creating Xtext)

Was there anything interesting that happened during the writing of the book?

Well, when I started to write the book, Xtext was version 2.3… After writing half the book, Xtext 2.4 was released. The new release created a new version of the projects (Xtext comes with project wizards that setup most of the things to get you started), in particular, Xtext 2.4 started to rely mostly on Xtend (a Java-like language, completely interoperable with Java and its type system). This meant that all the examples had to be rewritten, and also many parts of the chapters that had been already delivered. I think that this makes the code of the examples (also shown in the book) much more readable, and that’s why the title has been changed so that “Xtend” appears in the title as well.

How did you find the overall experience of writing your book for Packt?

It was a lot of stress, but also a whole lotta fun in the end!

What disturbed me most was that I had to use WYSIWYG editors like LibreOffice and Word… I use LaTeX type setting system all the time; LaTeX is so powerful once you learned it that it was a real shock (and nightmare) to fight against the rigidity of Word.

What tools or configuration do you use for your workstation?

I’ve been a Linux user for decades, and I’ve written the book on a very pleasant Linux Mint distribution. I only had to switch to Windows to deal with some problems in the files that required Word instead of LibreOffice.

Thanks Lorenzo!

If you want to learn more about Xtext and Xtend, you can buy Lorenzo’s book here. Packed with plenty of examples it’s been designed to give readers a practical and accessible insight into a complex area of development.


Please enter your comment!
Please enter your name here