McMaster Workshop on Domain Specific Lanaguages.

June 13 - June 14 (Public Workshop), June 15 (Workshop for Project Participants)

9am-12pm, and 1pm-4pm

Engineering Technology Building 237

Organizer: Christopher Anand

Presenters: Edward Kmett and Wren NG Thornton

This workshop will introduce the concept of embedded Domain Specific Languages and their application to problems in software design, through several examples. Roughly half the material will be accessible to beginning graduate students in Computer Science or Software Engineering. Some of the material will require advanced knowledge of Haskell and Category Theory, but non-experts should still benefit from seeing the power of these ideas in more advanced applications. Some examples, mostly on Monday, will use Scala, which will be easy for Java programmers to follow.
Following the lunch break on the 14th, our industrial sponsor, Indellient Inc. will present their digital pen technology. Everyone is welcome for this public demonstration.
At the end of this workshop, we hope you will be convinced that DSLs are an excellent way of approaching new design problems, and result in very robust and maintainable code. You will also have a set of starting points to continue your exploration of the topic.


What DSLs are.
Shallow vs. deep embeddings. Lenses.
Monadic APIs vs. non-monadic APIs For the monadic APIs there is the consideration of initial vs. final encodings. This is probably the most theory-heavy part of the material.
Initial encoding, in particular via free monads
Using codensity to improve the asymptotic performance of free monads.
Final encodings for languages that lack GADTs, or to make deep embeddings shallow.
Observable sharing via stable names.
* unsafePerformIO to allocate references and Lava for observable sharing.
* Kansas Lava - observable sharing via StableName allocation
* final encoding - automatic differentiation
Other examples
* SAT/SMT sovers
* Nikola - deep embedded targetting GPUs
* uses of Template Haskell
* JMacro - EDSL for emitting javascript in haskel


Day 1

 9:00- 9:30 Getting organized 
 9:30-10:00 What is a DSL? (Edward Kmett)
10:00-10:30 Smoothing probabilities in Haskell (Wren Thornton)
10:30-11:30 Lenses in Scala (Edward Kmett)
11:30-12:30 Break
12:30- 1:30 Forward-Mode Automatic Differentiation in Haskell (Edward Kmett)
 1:30- 2:00 Building Train Tracks with AD in Haskell (Edward Kmett)
 2:00- 3:30 Dependency Tracking in Java / What is a monad? (Wren Thornton)
 3:30- 4:00 Questions & wrap up

Day 2

 9:00-10:00 Dealing with Binding: HOAS, deBruijn, etc. (Wren Thornton)
10:00-11:00 Free Monads and Codensity, Quantum Probability & Coroutines (Edward Kmett)
11:00-12:00 Unification & Data Types a la Carte (Wren Thornton)
12:00- 1:00 Break
 1:00- 2:00 Observable Sharing in Circuits and Reverse-Mode AD (Edward Kmett)
 2:00- 3:00 Demonstration (Indellient)
 3:00- 3:30 Finally Tagless DSLs (Edward Kmett)
 3:30- 4:00 Template Haskell for DSLs (Edward Kmett)

Slides and Code