Posts

Showing posts from December, 2024

The Perils of Productivity

Image
After a busy and exhausting set of end semester exams, I got an extra day off before my final exam - German. I decided to be productive - and attempt something I had not before - write a compiler. Writing a compiler is one of the most common projects that CSE students take, and I found writing assembly code fun this semester - so I thought, why not try writing my own compiler? I booted up my Linux machine. Gathered the resources. Kept snacks at hand - and immediately got stuck. The guide I was using (for writing a Python compiler in Python) required me to update my Python installation to Python 3.11 - no big deal. I did it, and started following the tutorial. I finished writing the first part - a tokenizer - and now, began following the steps to test it.... Error after error kept popping up. Looking back - I should have stopped here. But I did not - I went to everyone's favorite source of programming knowledge - ChatGPT - and began finding solutions. After a couple hours, I was fru...