Reflections on Building a Programming Language

I’ve been working on a programming language called blue (link)for about 6 years now. It started off as a learning experiment from Thorsten Ball’s excellent Writing an Interpreter in Go. Little by little I expanded upon it, learned more, and kept going with it.

If you look at my git history there are plenty of times where I spent a lot of time working on it, and other huge gaps between the last commit. I kind of like this type of programming. There’s no stress, it’s just for the fun of it. Which I think is much needed in today’s current climate.

What sparked me to write this post is really that I finished up the VM part of it (again inspired by Writing a Compiler in Go) and this was one of the small goals I had for this year. I didn’t think it would take that long to get through it but I just wanted to have something small and achievable to get through.

There are plenty of programs that “they” say you should try for yourself as a programmer. One of those is a programming language and I think I agree with the hindsight of the last 6 years. It truly has given me perspective on how every type of language operates, even if my language is high level. Some others like a text editor or an operating system are also things I’m interested in but I haven’t really explored those too deeply.

One thing I found surprising by working on this is that I was able to just keep going. I found initially when I would start to program I would have an idea and then not actually follow through with it. The bigger it was meant it would typically be hard to just keep it going, and yet, with this language its now been 6 years and I still work on it.

The biggest thing is motivation. Just like I am with reading, I don’t try to force myself to program if I’m not motivated to do it in the first place. It has to just come naturally. Such as some feature that I’d like to see done, or even just some cleanup that I think would make the language better. During some of the past years, I would try to blue to get some of the advent of code work done or other generic coding puzzles where I would then discover tons of bugs and issues that would then get me hooked into cleaning it up and working on the language yet again.

I can’t say for certain how much longer I will continue to work on it. I’ve used this mainly a learning playground for a lot of other things typically like some UI or game development work. Most likely I will continue to try and expand it further by testing out new libraries and building other small tools here and there but its not a serious thing. Just trying to have some fun programming that scratches the proper itch at the time.

I’d recommend anyone try to do something similar, you don’t even really need to share it with anyone but just writing for yourself is a good thing and there are plenty of things left to learn.

Postscript

In the future I would like to clean up the language and write some proper documentation as well as a website for it but for now its just going to continue to live in git and I will hopefully continue to find the motivation to keep it moving forward!