SCJ-0649 Design and Effectiveness of Internal DSLs in Scala | Voxxed Days

Voxxed Days Ticino 2019
on Saturday 5 October

   Design and Effectiveness of Internal DSLs in Scala


Programming languages
Programming languages
Intermediate level
Room C Saturday from 12:10 til 12:55

Domain-Specific Languages (DSLs) are machine languages tailored to a particular application domain, allowing to produce more concise and understandable programs, with a tighter stakeholder integration. In particular, internal DSLs are a particular class of DSLs written inside a given general purpose programming language. Not all programming languages are equally effective for this. Through quotes of Martin Fowler, some history, and code examples, we will learn why you should care about internal DSLs and more importantly a great language to design them: Scala.

We will discover how a few simple but powerful Scala features, like symbolic method names, infix method calls, and call by name, enable the elegant design of internal DSLs. As a reference domain, we will focus on testing, illustrating the usage and the design of frameworks like ScalaTest and ScalaCheck, with a lot of code. Thus, the outcomes of this talk are twofold: First, you will learn how a DSL can help you write powerful and elegant tests - even for your Java programs. Second, you will learn how you can leverage that elegance to design your own DSL on a specific application domain (but only if you’re brave!).

DSL   scala   testing  
Andrea Mocci
Andrea Mocci
From CodeLounge @ Software Institute, USI

Andrea Mocci is a Junior Group Leader at CodeLounge (, a R&D lab headed by Dr. Marco D'Ambros and Prof. Dr. Michele Lanza at USI, Lugano. His main responsibilities include leading the technical decisions for CodeLounge projects, and a lot of actual development, mostly on the backend side. He's passionate about functional programming in many flavors, languages like Scala and reactive technologies like Akka. In the past, he has been a postdoctoral researcher in the REVEAL group headed by Prof. Dr. Michele Lanza of the Software Institute in USI, Lugano, and postdoctoral fellow and associate at Software Design Group at MIT. He's got his PhD with Prof. Carlo Ghezzi at Politecnico di Milano in 2011.

Make sure to download the Android or iOS mobile schedule.