Contributing to D, SAoC and DConf 2019
03 October 2019

This year I’ve been through a couple of interesting experiences that I think deserve sharing. Last autumn I took part in the Symmetry Autumn of Code project, hosted by the D Foundation, which led me to give a brief talk at DConf 2019in London.

The whole project was very instructive and had lots of fun in it, so I figured it was about time I went into details and wrote something down. I am a bit lazy, so it took a while.

D language stuff pt. 1: SAoC

The whole thing started with the missed opportunity of taking part in the 2018 edition of GSoC, mainly due to the fact that I forgot the submission deadline for my project proposal: another case of obstinate laziness, plus an oversight. The D programming language was, and currently is, of great interest to me, therefore the first thing I did was to skim through DLang wiki’s page about GSoc 2018 and shortly after, with my friend FraMecca I found a proposal for a HTTP/2 implementation in Vibe.d, which I believe is the most mature between D’s async/web frameworks.

Getting in contact with Sönke, the mantainer and author of the Vibe.d project, was quite straightforward. He was very welcoming and helpful, which led us to start collaborating with him to a rewrite of the vibe-http module.

Now, this was outside the boundaries of GSoC and I didn’t know about Symmetry Autumn of Code at the time, since it hadn’t been announced yet, but shortly after news came down that the D Foundation would promote its version of the GSoC project so it seemed like applying for it was natural consequence. It was August 2018 when I sent the application and was told I was accepted, along with Francesco and another applicant, each one of us would have its own project to work on. Project started in September with an outline of 4 milestones, meaning partial objectives which had to be delivered monthly, that were planned between me and my mentor, Sönke, since my application for the HTTP/2 implementation had been accepted.

HTTP/2 is a transmission protocol which builds around HTTP, by introducing stateful connections, load balancing, binary serialization and compression of request/response headers. Its main purpose is to exploit network resources more efficiently than HTTP/1.1.

Now you can take a deep breath and read through RFC 7540 and RFC 7541.

Why SAoC and what happened

First of all, SAoC meant working on open source code. This means working from inside a community which is made of a large number of different people, most of which (may) have the occasion of meeting each other once a year. I never did anything like that. Moreover, contributing to Vibe.d, which is completely open and hosted on GitHub means being able to show the results of my work easily. Guess I don’t have to explain the ethical implications of sharing code (FOSS in particular). Add to that the quite challenging project to be built, and it gives a great mix of programming at the most disparate hours of the day and a pinch of that OH-MY-THIS-CODEBASE-IS-HUGE-AND-I-NEED-TO-READ-THROUGH-IT feeling. By the way, Vibe.d codebase is not that huge and I found it quite intriguing, yet it was my first experience with a well-grown, structured project of the sort. Also, you get paid, which being a student helps a lot.

I had help and guidance, especially from Sönke, with whom I discussed implementation, strategies and each one of my PRs to vibe-http. The whole process was made of emails, issues, PRs, and a lot of documentation to read. This taught me how to work with a project that’s not mine, use it and modify it methodically, while providing a solid base to implement a substantial amount of code inside it.

First, strange docs showed up, I had to read a lot. Vibe.d docs, codebase and API, RFCs, other HTTP/2 implementations, all of them had to be somehow digested before the actual implementation effort could begin. After that, weird bugs appeared. Getting rid of bugs was and is still fun, a lot of work is still to be done and I whish I could put more time into it, yet it’s getting hard with my master thesis on the go. I am hoping to complete it by the year though, and hope that the module can be merged in place of the current vibe.http.

End of SAoC

January was the month marking the final deadline for milestone development. We managed to build the whole HTTP/2 server, which is experimental, needs testing, but works. It currently lacks load balancing, yet it is true that HTTP/2 RFCs does not detail a specific load balancing strategy, instead providing a framework to adapt it to one’s specific needs. According to the network usage, the resources that has to be transferred and the performance requirements of each application, this can make a lot of difference.

At the end of January we submitted the last PR and started a review process, that protracted until May, when I was invited by Mike Parker to DConf 2019 to give a talk about what was accomplished and to provide a feedback for future SAoC editions, such as this year’s one.

London is huge

I suck at writing talks, especially if they involve slideshows. How some people manage to write entertaining presentations which are pleasing to attend to and display a polished, properly designed slide template is beyond my comprehension. Plus, I was scared of what I had agreed to do. I had no reason, yet it seemed that the task was of extremed importance. I still regard it as such yet it wasn’t such a trauma after all, on the contrary it was fun. Extremely fun.

I won’t go into details, a video of my talk and the presented slideshow is available from the links at the bottom of this post. I mention the conference because it was inspiring and allowed me to meet and share thoughts (and various beers) with developers and computer scientists from all over the world, which was worth all the preparation and panic-mode-slide-layout-refactoring that it involved. I felt like a holiday, one full of fellow nerds and welcoming people. And computers, talks about programming, some of which I still need to fully grasp. Taking part in DConf allowed me to gain perspective about what can be accomplished by a collaborative effort. This takes discussion, brainstorming for ideas and a lot of keyboard clacking in the process.

In the end

I would do it all over again, and probably will, if the occasion presents itself. I believe that promoting a collaborative approach has incredible benefits on software development and the D community proved itself to be one in which contributors are welcome and each one who starts a discussion is given attention while being treated with regard. Expressing oneself is possible, and it is satisfying to see that efforts towards creating something and contributing is so appreciated.

The thing I appreciated more is that SAoC has been an incredible learning occasion. It put me in front of issues to overcome and showed me how development moves forward. Such experiences are fundamental training tools to learn aspects of development which by oneself are impossible to practice. The gain from this is flexibility, experience and meeting a lot of fellows who have similar interests and probably are spending ten times the effort I put into it.

I advise anybody who is interested in improving his/hers programming skills to consider the possibility of a similar experience. Feeling like a complete n00b has never been so easy.

For a more detailed tale of all the highs and lows and beers in between this short recap, here’s my references:

                /###\     /\                    
               /  ###\   /##\  /\               
              /      #\ /####\/##\              
             /  /      /   # /  ##\             
           // //  /\  /    _/  /  #\ _          
          // /   /  \     /   /    #\ \         
         /  \   / .. \   / /   _   { \ \