The Perils of Productivity
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 frustrated at my lack of progress and decided to do something else. Exiting the terminal, I tried to shut down the laptop.
It did not.
I tried opening the terminal again. It did not.
And then I forcibly powered the laptop down by long pressing the power button.
Upon booting up again - my desktop environment had bid me a fond farewell, leaving me with a TTY terminal for company.
To cut a long story short - I spent the rest of the day mounting pen drives to the filesystem and backing up my data, trying various methods of uninstalling, purging and reinstalling the DE, before giving up and installing a fresh distro.
Had I chosen not to be productive - I'd have saved myself an entire day of pain, and a few read cycles on my pendrives.
What is the moral here? When you get a day off, use that day to relax. Productivity can wait :D
Comments
Post a Comment