DEV Community

Weekly Typed
Weekly Typed

Posted on • Originally published at weekly-typed.com on

Compilers Could Be Way More Fun

Compilers Could Be Way More Fun

This post originally appeared on Weekly Typed

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 or github workspaces would be a HUGE improvement! Or what about tools like Rustlings or 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, 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.

Top comments (0)