This morning I spent about an hour or so trying to find out where I've lost a couple of my bytes. Lost, skipped, or forgotten? I'm not really sure. All I know is, they are not where I expected them to be. Such are the troubles one faces when working on a compiler I guess. It's still quite fascinating, even when it's annoying. The constraints are known, there are no dependencies, just the code you have written. It's glorious when you understand everything that's going on, from the input to the stack. You know where each byte is supposed to be, if it's still there and where it is right now and where it's going. This in my opinion is the purest and most fun part of programming. There are no docs to read, all there is to do is to see what is actually happening, there is no edge case you have missed which is mentioned in a doc somewhere. It's pure and permissionless. Which is a stark contrast to the rest of life. Most of it is out of your control and most of your time is differentiating one from the other. Yet somehow this couple of hours spent working on the compiler carries me through the day. Gives me at least one reason to want to get up when the alarm goes off. It's all a bit doom and gloom, but such is life sometimes. It can be a hard and merciless bitch. Yet, I believe it happens for me. I have to.
The compiler is not easy but it's not as hard as I imagined it to be. At least to build one to develop a basic understanding of what really goes on when I type, go build
or zig build
or go run
or zig run
. It's one small dot in it's place. One that does not make sense right now but somehow in a distant future I'll look back and go, "Aha, that's what it was for". At least that's what I tell myself.
A time for play
I've realized, I never left any room in my day to do something fun. So yesterday after I finished everything I wanted to do I played counter strike for an hour. It was quite relaxing. I think I'm going to do it more often. Somehow I never gave myself permission to enjoy playing a game, maybe in the fear of overdoing it and wasting all my time. Yet at the end of a day, when every task is done and then some more, why not? It's strange the rules I impose on myself.
Anyway all of the above might come across as weird, but it has been such a morning. One where I woke up and questioned my own sanity. Big mistake.