Compilers Could Be Way More Fun
Tags: compilers
Published: 2023-02-05 18:58:23

---
title: Compilers Could Be Way More Fun
published: true
date: 2023-01-21 18:37:50 UTC
tags: Compilers
canonical_url: 
---

 ![Compilers Could Be Way More Fun](https://images.unsplash.com/photo-1616892698956-e9a649a991b5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDI3fHxiaXNvbiUyMHNub3d8ZW58MHx8fHwxNjc0MzI3NTA2&ixlib=rb-4.0.3&q=80&w=2000)

> This post originally appeared on [Weekly Typed](https://www.weekly-typed.com/compilers-could-be-way-more-fun/)

I've had this idea kicking around in my head for a while.

For the past year, I've been slowly learning about compilers, DSLs, and language engineering. It's a lot to learn, for sure. But it's a lot harder given the resources available. Sure, there are textbooks, approachable books, some video series. But there just are not _enough_ of them.

## We need more voices to learn from 

Many years ago, I decided to read a book by Tony Robbins. I don't remember the book, and I had too short of an attention span to finish the first chapter. But even in those few pages, I found something that's stuck with me. It's obvious, actually, but easy to forget.  

To paraphrase him: sometimes you can hear the same thing explained 9 times by 9 different people and it still doesn't click. Then that 10th person explains it, and it all falls into place. They don't have to be particularly clever about it, either.  Maybe they just think a little more like you.

## Missing a modern approach

There are some other things that are just missing in the existing resources. For example, usually the project's build setup is glossed over. This makes sense, because it seems outside the scope of a book or video. But here's the thing. Even if I don't know the language you're using in your book, I can figure out what you're doing. But I might not have any clue how your build tools work. So if I have to debug your build script before I can start, you've lost me.

It would be nice to use some modern services to get people set up and working through a practical project. Something like [gitpod](https://www.gitpod.io/) or github workspaces would be a HUGE improvement! Or what about tools like [Rustlings](https://github.com/rust-lang/rustlings) or [Ziglings](https://github.com/ratfactor/ziglings)? This is starting to sound like a job for a community.

## Compiler-nomicon

So that's what I'm going to try to build. The initial steps will be to create an open source document designed to help anyone understand (and build!) all the parts of a compiler. But I want to quickly expand from there, to include all kinds of topics related to language and compiler design. Not just the basics, and not just high-level. Advanced topics about real features you find in real languages.

> For example, many books teach you how to build things like simple functions, methods, structs and classes into a new language. But what about enums, interfaces, traits, ownership, pointers, records, type classes, data classes, higher order functions, lambda/nameless functions, and so on. I want to get into that.

Around this documentation, I want to build a community of contributors. I want the code examples to be in as many languages as possible. If you're interested in helping, you can get involved a couple ways. You can either sign up for updates to this blog, leave a comment, or email me directly. See the about page of this site for the details. The documentation will be on [github](https://github.com/tofraley), so we'll coordinate there.

I'll have more to say on this soon. If you have any questions or feedback, sign up and comment!

Thanks for reading.