Growing a DSL for financial calculations

Slides for my talks 🎤


The story of how my colleague and I ‘discovered’ a Scala DSL for writing complex mortgage calculations.

Abstract

Rabobank is a Dutch multinational banking and financial services company headquartered in Utrecht, the Netherlands. One of their services is providing mortgage loans. Determining the height of the loans involves some rather complex calculations. They were struggling to represent these calculations in an understandable and reliably testable way for both domain experts and developers. We helped them develop an internal DSL in Scala that allows them to express these complex calculations in an idiomatic way that is not just easy to read for both developers and business analysts, but more testable as well. Harnessing functional programming principles and the strong Scala compiler, it also provides full typesafety with a syntax that lies very close to human language, allowing fully typesafe constructs such as ‘amount per month’ and ‘amount per year’. In this talk, I will explain the concepts behind the DSL, how we implemented them without adding any dependencies to the project (except ScalaTest, of course), and the design decisions we had to make along the way.

Deliveries

  • 7 October 2016, HBO-ICT Job & Student event Rotterdam: [event]
  • 4 May 2016, Typelevel Summit Oslo: [event] [video]
  • 13 April 2016, Appril Festival: [event]
  • 31 March 2016, Brabant Scala Meetup: [event]
  • 24 March 2016, Codestar Launch Event: [event] [partial video]
  • 23 November 2015, Scala Utrecht Meetup