Week 1
I wrote a lexer for the proposed language, Sphere, using Flex. I tried doing it manually using C but it required so much work. I gave up when I saw how much code was needed to just open a file and gave Flex a try. Flex is quite intuitive. Given that a lexer’s output is mechanical, turning strings into enums, I think using a lexical analyser generator makes sense.
I am using this thing called X macro to generate enums and an array of strings so that I can print the converted tokens and it feels very hacky to me. I was constantly thinking how me not being able to understand something immediately is because C is an ancient language. And I should start using Haskell instead. But I think that’s just an excuse. It’s not as if I know Haskell well. Even if I decide to write the compiler in Haskell I’ll still need to learn new things, such as parser combinators.
Head First C is an amazing book. I looked at many different C books and read some of their chapters. Most books on programming languages have this issue of introducing tiny subsets of the language in a sequential manner. And then explaining each construct in detail. How are programmers expected to read how a for
loop works for the 19th time? Head First C is great because it throws the kitchen sink of all common language constructs in the first chapter. We need more books like this. Introduce common language constructs early and then spend more time on what makes the language unique in later chapters.
I set up Latex Workshop for writing my dissertation. Feels just like Overleaf but faster!
Tried a burrito from Mission Burrito. The portion size was too big for me. I was mainly excited about trying Jarritos Mexican Cola. I loved it – very tasty!
Attended Bristol Hack Night. I saw Katie and Jonathan’s split keyboard. Both looked great. I had a nice chat about programming languages and garbage collection with Steve.
Visited Durdle Door and Lulworth Cove. It was spectacular.





