The Developer Open Space in Leipzig
The #DevSpace is a swarm-funded developer conference in Leipzig (Germany) organized by Torsten Weber. From developers for developers. The conference has no agenda, and so the audience determines the topics they will talk about. They use the World Cafe approach for that. That means, people suggest the subjects and then vote for them. Topics with the most votes will be addressed over the weekend. Interesting approach – and it works!
On the first day, mostly Friday, there are workshops preceding the conference weekend. This year, I had the privilege to organize such a workshop. And so I came to Leipzig with my talk #SpeakRoslyn about the Microsoft .NET Compiler Platform, also known as Project Roslyn. This was the first time a gave this talk in the form of a workshop. And it was fun all the time!
I divided the workshop day into two parts. In the first part, we talked about the motivation behind Roslyn, followed by in-deep compiler theory. Then we talked about the compiler and workspace APIs. In the second part, I became more practically for the audience. Two tasks had to be performed.
First, they had to figure out how the .NET Compiler Platform solves syntactic problems, so that it can always generate an Abstract Syntax Tree. Regardless, which syntactic errors there are, Roslyn always generates a valid tree. Just to be able to always be roundtripible with code and the tree. Therefore, it uses two error compensation approaches. By writing syntactical incorrect code and using the Syntax Visualizer, the attendees had to figure these approaches. They’ve done it with success.
The second tasks was to implement a Code Analyzer and a Code Fix. The analyzer has to find undocumented methods. The CodeFix should provide a fast solution to add the documentation to the methods. I think I had a great audience, since they solved this problem, too. In the given amount of time! That was great to see, how they solved it.
The workshop was great for me. My audience was very interested and they followed me with high attention, curiosity and meaningful discussions – up to the end in the evening. I think, we all had a lot of fun and learned a lot from each other. I am very grateful for the best-ranked feedback from the audience.
What they’ve learned
- Internals of the phases of a compiler pipeline.
- Formal languages and their mathematical descriptions/definition (notation, language grammar, Backus-Naur-Form).
- How state machines can be constructed for a grammar and how they can recognize inputs.
- How lexical and syntactical analysis works (lexer, parser).
- About Syntax Trees as a fundamental concept and data structure within a compiler.
- How semantic analysis works (symbols, symbol tables and binder).
- How code is generated and optimized (platform-independent optimizations, code generation, platform-dependent optimizations).
- Roslyn APIs – Compiler API (including Diagnostics API), Workspaces API and their object models.
- How to change the C# compiler to add new language features.
- How to analyze, generate and transform syntax (SyntaxWalker, SyntaxFactory, Replace*, With*).
- How to write a Refactoring for Visual Studio.
- How to write a Code Analyzer and Code Fix for Visual Studio.
- How the Workspaces API is used to load plugins into Visual Studio and provide document-wide, project-wide and solution-wide refactorings and Code Fixes.
- How to debug these Visual Studio plugins.
- And a lot more…
You can find the slides on SlideShare here or directly below! 🙂
The code is available on GitHub here.
Last but not least, here are some impressions:
Many many thanks to all the attendees and to the orga team! It was a great time for me and I hope you learned a lot! Please feel free to give me feedback in the comments to this post! I would really appreciate to read it!
And: Don’t forget to #SpeakRoslyn!