Wilfred Hughes wrote an Emacs major mode for Cask. Afterwards, he distilled what he learned into a post on writing major modes. The post is not a tutorial on how to write major modes; it's a few tips that will make things easier.
This post is a nice followup to a previous Hughes' post that did serve a tutorial role. I wrote about that post here. If you're thinking of writing a major mode or think you might in the future, it's worthwhile bookmarking both his posts.