De-constraining DSLs!

By Afsal Thaj

Elevator Pitch

Let’s make our application introspectable, optimisable and thereby observable. While there are varying techniques, there are hurdle in the details even in languages that supports functional programming. We will go through a major hurdle, and a solution in real world, inspired from a Haskell paper!

Description

Deconstraining DSLs

The key to many introspectable, optimisable and thereby observable programs such as an execution planner, a configuration DSL etc, is the basic concept of “programs as descriptions”. However, this idea often come with limitations. With this talk, I am going to take a real world example that we have in Disney Streaming, explain the problem even better and make a solution backed by literatures.

Here is a few more details to those who know introspections through DSLs with initial encoding. This description of program encoded as code can easily turn out to be a recursive tree that takes the shape of Generalised Algebraic Datatype. Given this program is highly polymorphic to allow itself to be a reusable structure, the corresponding compiler then has to traverse through these unknown types at various nodes in the tree, disallowing it to do anything useful. There are many possible ways to come out of it, such as compromising modularity and parametric polymorphism, and perform runtime casts.

Here will cover a different take on this problem with some Live Coding in Scala (https://github.com/afsalthaj/constraintless), fully inspired from a Haskell paper, plus a few other interesting bits to back up!

If time allows, we can even uncover the possibility of this problem and this solution in other languages, making it even easier for those who are new to Functional Programming!