My nCrafts talk (On Growth and Software) is, in a sense, applied physics of software, that is, it's an example of the reasoning style that is supported and inspired by an understanding of forces and reactions. That's one step from theory into practice.
At the end of the talk, I quickly proposed a simple way to break symmetry in a traditional OO language (C# in this case) and how we can make it completely type-safe through an extension to the language, that is, the ability to impose constraints on the type systems in the form of (logical) implications.
The straightforward way to do so is to modify the language / compiler, but it turns out that with the latest C# compiler you can extend the compiler pipeline to some extent, through so-called Code-Aware Libraries. You can't add new keywords, but if you can reframe your extension in terms of the existing language, the big win is that a Code-Aware Library will work with the standard C# compiler.
I decided to do yet one more step into practice and implement my extension as a CAL. It was relatively straightforward and it worked well in practice, although I had to accept a slightly less minimal syntax. Here is an example of the error messages you get when:
- you try to safely cross-cast between interfaces not related by an implication.
- you state an implication between interfaces, but then have a concrete class that does not respect the implication.
At the end of the talk, I quickly proposed a simple way to break symmetry in a traditional OO language (C# in this case) and how we can make it completely type-safe through an extension to the language, that is, the ability to impose constraints on the type systems in the form of (logical) implications.
The straightforward way to do so is to modify the language / compiler, but it turns out that with the latest C# compiler you can extend the compiler pipeline to some extent, through so-called Code-Aware Libraries. You can't add new keywords, but if you can reframe your extension in terms of the existing language, the big win is that a Code-Aware Library will work with the standard C# compiler.
I decided to do yet one more step into practice and implement my extension as a CAL. It was relatively straightforward and it worked well in practice, although I had to accept a slightly less minimal syntax. Here is an example of the error messages you get when:
- you try to safely cross-cast between interfaces not related by an implication.
- you state an implication between interfaces, but then have a concrete class that does not respect the implication.
The code/extension is not public yet and you'll have to watch the presentation to understand the reasoning behind it.
So this is a double step into practice, or as I mentioned in my DDDEU talk, an example of how understanding forces can ultimately lead to create materials (language constructs) on purpose, pretty much like material engineering.