Skip to content

Haskell Mode 2015 retrospective

Dan Aloni edited this page Jan 23, 2016 · 2 revisions

(written by Gracjan Polak)

Towards the end of the year 2014 I've read a post title How to be an Open Source Gardener by Steve Klabnik, you may read it here:

http://words.steveklabnik.com/how-to-be-an-open-source-gardener

Somehow it stuck with me because gardening always sounded like an interesting hobby. And I was looking for a hobby that was neither too close to my day job which was Haskell programming nor too far away to be irrelevant. Since Haskell is a lexically scoped statically typed general purpose language then what could be a better complementary hobby than a dynamically scoped dynamically typed embedded language that is Emacs Lisp?

Then I calculated that Emacs is one of the top if not the top editor used for Haskell source code. Users are programmers so there is a non-zero chance of a user-to-contributor spontaneous conversion. Given enough gardening there a Haskell Mode community should appear and then we will see where that leads us.

Haskell Mode is a bunch of Emacs major and minor modes, put together in a single package. Although the amount of elisp code (wc -l *.el says 18426 total) is a bit intimidating the modes mostly do not interact with each other making them quite easy to hack. Haskell Mode saw many contributors before I came to the project. Even github says 75 but git does not have the whole truth because haskell-mode predates both git and github by a large margin. Two people deserve special mention at this point, that is Christopher Done and Herbert Valerio Riedel who were maintaining Haskell Mode in the past. Thanks!

I started hacking. Haskell Mode was my target because it was my day tool and I saw plenty of improvement opportunities. In January 2015 I also wrote some scripts that scrapped github API and listed recently closed issues and recently closed pull requests. But I didn't there to publish monthly report just then, I wanted to see if I have enough energy to do it a couple months in a row.

First months of 2015 went into fixing pretty obvious bugs that were lingering in the code. We dropped Emacs 20, 21, 22 and XEmacs support and officially started to support Emacs 23. There were tests written for simple indent mode, there were significant refactorings done for font-lock. Code got slimmer and more clear, duplication was removed. Steve Purcell was patiently reviewing my pull requests and pull requests of others that I pinged him about. Thanks.

In March 2015 I felt that gardening Haskell Mode is engaging enough that I will continue for longer. I asked Steve Purcell and Chris Done if I can join the project officially and I got access to github repo. I published March 2015 report on reddit and on haskellemacs mailing list.

Meanwhile cleanup continued and the next target was indentation. Haskell Mode featured three indentation modes at that time, neither was working even remotely correctly. Kristof Bastiaensen proposed merging hi2, yet another indentation mode to Haskell Mode. General opinion about hi2 was very high, hi2 was significantly improved by @nilcons as an outside project. There were ideas to merge hi2 as the fourth mode, that would be seriously confusing. Luckyli hi2 was an improvement over haskell-indentation, mostly compatible with it, so a replacement was done.

I also introduced project focus, a metric that was supposed to keep us on track. First project focus was to gain 100 contributors as measured by github. Fun game started because it nudged us to be extra responsive if not pushy to newcomers to contribute code or tests to the project. Initial number was 78 so it was a reasonable goal to achieve.

In April 2015 Luke Hoersten was active and helped a lot. yassnippets were moved to separate package. Travis scripts got significant improvements. It was a depressing month because a lot of really small really annoying things were fixed. I also learned that there are projects depending on haskell-mode in surprising ways. ghc-mod used an obscure function that we removed and we had to restore it a while after.

In May 2015 we spent some time on the marketing side of the project. Kristof Bastiaensen contributed our current logo that features a sleazy dynamically scoped Emacs E devouring a solid static Haskell bind. We have put it in some places to achieve increased brand awareness.

We had a pretty good run in June 2015. Arthur Fayzrakhmanov contributed company completion functions. Documentation got a couple of animated gifs to show the functionality. Overall documentation received a lot of my attention until I realized that I'm basically documenting bugs, misfeatures, bitrot or missing functionality. I decided that it is better to fix the issues instead of documenting them so documentation had to wait till we get the code to shape.

In June 2015 we reached project focus goal of 100 contributors! Yey, it felt good. Riding the wave other target was selected, one that should increase engineering quality. I've created a 'well-defined-task' label and put it on tasks that were so well specified that a newcomer could just sit an evening and write some useful code. This was also meant for regulars to think first code later as a believe in thinking.

In August 2015 Kosyrev Serge was courageous enough to enable lexical-binding in all elisp source files. Although we weren't using lexical closures (to this day we are not because Emacs 23 is still supported) Emacs error reports about unused or undefined variables are much better in lexical-binding mode.

In September 2015 I tried to strike up a conversation with other Haskell editor projects. Not much came of that initiative, I guess they are not reading our mailing list. Not a problem, I'm not reading theirs either.

But Haskell IDE Engine is taking off, which is the best news since, well, ever.

In October 2015 haskell-indentation-mode became the default and official. All tutorials could finally skip the shameful 'select indentation mode' section. Haskell Mode was finally working out of the box! We have also improved our development process by defining Complete functionality as a concept so that contributed pull requests include all necessary parts like tests, docs, keybindings etc.

November 2015 was the month of 'Illegal token' battle. Indentation was choking on tokens it did not like. Many people suggested that exceptions thrown should be caught and ignored, I stood my ground that indentation should support any stream of tokens and do something remotely sensible in every situation. After half a dozen issue reports we nailed down all points where indentation was throwing errors and fixed those. Right now indentation will never throw, but that does not mean it will do the correct thing, sorry.

In Decemeber 2015 quasi quotes got proper font lock support. Some quasiquoters are recognized and special syntax highlighters are used so that a quasiquoted HTML or SQL gets nice colors according to html-mode or sql-mode. One of indentation modes got eradicated leaving only two to confuse people. A lot of work went into haskell-indentation so that it can subsume haskell-indent.

That was 2015 in a nutshell. In 2016 we already implemented code coverage tool and already have 32% coverage, we plan to drop Emacs 23 soon, add some more semantic colors to font lock, improve REPL and, dare I say, maybe indentation will start to actually work?

I'd like to keep building a community of regular contributors around Haskell Mode. Haskell is an insanely rich language both in syntax and in semantics and there is a lot of interesting things to get done to improve productivity for Haskellers around the world. Emacs Lisp is nicely different, Emacs is a close programming environment with a limited set of functions to learn so it is not brain taxing. There is true joy to be found in improving the tool you use every day.

Thanks for listening.

Go to Contributing section directly.