Hakyll

Posted on December 12, 2018 by Eric

Welcome to my new website! This website will serve as a personal website to showcase projects and achievements since I need to compile all that stuff into one place… if I had any amazing achievements or projects in the first place. Since I don’t have a billion dollar start-up idea, I’ll just showcase my mundane portfolio. This place will also serve as an outlet for any ramblings I might have.

The first project on the list is going to be this website since we’re already on the topic.

I’m using the Hakyll static website generator to create a static website because I don’t really wanna pay for dynamic website hosting. Also, static websites are supposed to be easier and quicker to load compared to dynamic websites.

Why Hakyll

Github Pages is most easily integrated with Jekyll, which is Ruby, but I always wanted to do something with Haskell, and Hakyll is like a Jekyll port to Haskell with a lot of extra additions. For those who haven’t heard of Haskell, it’s a functional programming language (no, functional doesn’t just mean that the programming language works). It’s one of the best in the field of studying Type Theory supposedly, which is really cool since Type Theory is one of the few intersections between math and CS. Furthermore, it fits my alley – if I wanted to be a non-computational linguist I would be in semantics/syntax, and part of the compositionality of grammar that is central to syntax and semantics is leveraging types to make the mathematical representation of language coherent. Additionally, since Haskell was designed by academia for researching concepts like Type Theory, it serves as a learning tool to learn how to program better (not necessarily more efficiently. I’m pretty sure exploiting buffer overflows is not good practice, but it is fast).

My Workflow

To modify my webpage, I use the standard git repo. Since I’m the only one working on this, I’m working off my main branch on my remote. Github Pages has this weird constraint which was never explained properly: to set up a webpage for a user (in my case, to set up eye942.github.io), the static webpages must be served from master. This isn’t exactly easy for me to do since Hakyll generates its webpages into the _site folder. Currently, what I do is I push into src, my main branch, and then I subtree push the _site folder into master. Since I don’t like redirecting since it feels sort of janky, I use the subtree push hack. Alternatively, I could set up a git-hook script on update, but I think that needs to be server side to which I don’t have access from what I’ve read. I’m also trying to setup some sort of CI instead of the weird subtree push.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.