Brainjam IDE
Motivation
After writing a Brainfuck interpreter one afternoon instead of studying for exams, I wanted to try my hand at writing an outright compiler, too. While working on the compiler, I found myself in need of developer tools and decided to create a complete IDE to support the compiler.
Interpreter
I don't remember how I first heard of Brainfuck, but I thought it would be amusing to write an interpreter for it, which I did in both C++ and Python. Due to the simplicity of the language, it took no more than an afternoon to complete, so I felt it would be a good candidate project to develop further. At this point in time I was in my 2A term at university, and had no experience writing compilers yet, so it seemed like a great learning opportunity.
Compiler
I spent probably around a week piecing together the x86 instructions I would need, and although I didn't add any complex optimizations, I did make a few simple ones (such as combining multiple adjacent increment instructions into a single add). A big part of the challenge here was finding documentation on what instructions were available, and properties like whether or not they supported immediate values.
IDE
The IDE was built using ImGUI, an exceptional C++ UI library primarily intended for developer tools. The IDE features built-in integrations with the compiler, such as a window showing build and run results, as well as simple IDE features like matching bracket highlighting. The IDE was interesting to make because although I used SFML for window management, pretty much all of the render logic is handled by ImGUI - this is in contrast to all of my other projects where most of the render logic was done by SFML.
Current Thoughts & Learnings
Although the compiler itself isn't very impressive anymore (we write simplified C compilers in CS 241 for MIPS), I think the timing of when I worked on this project was perfect for me, as I was quite well prepared for 241 when I ended up taking it. Additionally, this is a project that I often end up talking about during interviews, so I would highly encourage anyone thinking of working on a project like this to give it a shot!
I learned a lot about the structure of programs, and it laid a lot of foundational groundwork for my future CS learnings.