PWAs in Haskell - Choosing a topic

Part of series Bachelor's thesis (post 1 of 2)

Posted on September 22, 2018

So I finally have a bachelor’s thesis topic - my task is to create a full-stack web framework for Haskell, and I have maybe eight months to do it (from now to the middle of May 2019).

How did I get here?

I’ve been looking for a suitable topic for a while now. I knew I wanted something challenging - but not Ph.D.-level challenging. I also wanted to work in Haskell - but that’s a mostly unknown topic at my uni. I needed a topic where I could present something as my own work at the end, together with a theoretical background - if I worked on an existing open-source project, I’d need significant results and the theory to back it up.

I went through a long list of topics from GSoC topic suggestions from previous years to ‘Next work’ sections of recent research papers. I found a lot of challenging topics (incremental GC for GHC was the first topic I investigated), a lot of practical-but-too-small topics, and a few topics of just the right size and in interesting areas, but I kept postponing and waiting for just the right topic.

The right topic appeared as a byproduct of my personal projects, Haskell websites (Yesod, Scotty, and some others). Maybe a year ago, I needed to create an interactive web interface. The obvious solution would be to use technologies I knew (React.js or Angular), but I’d gotten tired of writing JavaScript at my day job. I had my eyes on GHCJS and related projects for quite some time, so this was the perfect opportunity.

There are several frameworks built on GHCJS, but out of them I liked Reflex the most. (I guess part of the reason I chose it over the others was the added novelty and challenge of FRP, oh well…) But however much I liked it, it became obvious that there are a lot of things missing in Reflex and reflex-platform, that are present in most of the batteries-included JavaScript frameworks,

After a pause, I’d returned to my Reflex projects over the holidays, and I saw my perfect bachelor’s thesis topic. It needed to be refined, of course, but the basis was there. I’ve looked for inspiration in other frameworks and found Meteor.js among others, which was the very close to what I’d imagined the result of my thesis to be. Another topic I saw references all over was the concept of a Progressive Web Application (PWA), and that tied my topic together.

What will I do then?

Meteor.js is a full-stack platform in a quite wide sense of the word. It takes care of everything from the data layer, through back-end and front-end implementations, to the communication layer. There is a lively community around it and an ecosystem in which I didn’t find any obvious holes (great tooling, libraries covering many concerns, …).

As for PWAs, it’s mostly a Google-created buzzword that consists of a ‘PWA checklist’ and a few related tools. It captures recent trends in mobile and web application and tries to remove the line between them, with offline capabilities or push notifications.

I’d been especially interested in one item on the PWA checklist - ‘offline capabilities’. That’s a hard topic and looking at some PWAs, I didn’t like the application-specific protocols some used, nor the opaque and sometimes error-prone libraries used by others.

I’d like to focus on two things in my project: tooling that a developer from the JavaScript world would take for granted - a framework-specific debugger, profiler/benchmark tool, and testing tooling; and a full-stack data engine, from database integration to non-opaque synchronization.

I’ll need to focus for two reasons. One, I have only eight months, in which I’ll be working on this for maybe ten hours a week, which amounts to some 500h - and that isn’t much. Two, I’ve recently discovered Obelisk by Obsidian Systems, which is a tool trying to tie up the loose ends left by reflex-platform (e.g. deployment) and to build upon that (‘isomorphic rendering’). At this moment, I doubt I’ll use it in my work as it’s still a work-in-progress and I wouldn’t consider it stable, but I’d like to build my work so that it can be used with Obelisk after my thesis is finished.

In the next post, I’ll have a look at other web frameworks in detail, and try to identify the must-haves and nice-to-haves of such a framework. Then I’ll try to map it onto the Haskell/GHCJS/Reflex ecosystem, to see what’s missing.